Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bare rescue in load_session_from_redis silently discards wide variety of exceptions #97

Open
brodygov opened this issue Oct 6, 2017 · 0 comments

Comments

@brodygov
Copy link

brodygov commented Oct 6, 2017

There is a bare rescue (which rescues all exceptions that inherit from StandardError) in RedisSessionStore#load_session_from_redis.

This is extremely bad practice, because it will cause a huge variety of exceptions to be silently ignored, including virtually all exceptions generated by any ruby library, including ThreadError, LocalJumpError, etc.

https://github.com/roidrage/redis-session-store/blame/bcf779297078db78d7e17b868c40b1ffd4dea243/lib/redis-session-store.rb#L106

This is just the built in tree of exceptions that would be silently swallowed:

StandardError
  FiberError
  ThreadError
  IndexError
    StopIteration
    KeyError
  Math::DomainError
  LocalJumpError
  IOError
    EOFError
  EncodingError
    Encoding::ConverterNotFoundError
    Encoding::InvalidByteSequenceError
    Encoding::UndefinedConversionError
    Encoding::CompatibilityError
  RegexpError
  SystemCallError
    Errno::ERPCMISMATCH
    # ... lots of system call errors ...
  RangeError
    FloatDomainError
  ZeroDivisionError
  RuntimeError
    Gem::Exception
      # ... lots of gem errors ...
  NameError
    NoMethodError
  ArgumentError
    Gem::Requirement::BadRequirementError
  TypeError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant