January 2024
Intermediate to advanced
718 pages
20h 15m
English
Ruby exceptions are objects of class Exception and its descendants.
The raise method raises an exception:
When an exception is raised, Ruby places a reference to the Exception object in the global variable $!. The first form reraises the exception in $! or creates a new RuntimeError if $! is nil. The second form creates a new RuntimeError exception, setting its message to the given string. The third form creates an exception object by invoking the method exception on its first argument, setting this exception’s message and backtrace to its second and third arguments. Class Exception and objects of class Exception contain a factory method called ...
Read now
Unlock full access