Skip to content

Latest commit

 

History

History
70 lines (55 loc) · 1.28 KB

ERRORS.md

File metadata and controls

70 lines (55 loc) · 1.28 KB

Notes on Errors

for core rubysol only use built-in expections and errors - why? why not?

ruby error / exception hierarchy:

Exception
  NoMemoryError
  ScriptError
    LoadError
    NotImplementedError
    SyntaxError
  SecurityError
  SignalException
    Interrupt
  StandardError    <-- default for rescue
    ArgumentError
      UncaughtThrowError
    EncodingError
    FiberError
    IOError
      EOFError
    IndexError
      KeyError
      StopIteration
    LocalJumpError
    NameError
      NoMethodError
    RangeError
      FloatDomainError
    RegexpError
    RuntimeError    <-- default for raise
    SystemCallError
      Errno::*
    ThreadError
    TypeError
    ZeroDivisionError
  SystemExit
  SystemStackError

references:

custom errors in contracts

derived from custom Error (and StandardErrr)

assert condition, "error message"

should be translated to

if !condition 
  revert CustomError 
end

revert CustomError    if !condition

references: