I\'m defining a custom Exception on a model in rails as kind of a wrapper Exception: (begin[code]rescue[raise custom exception]end)
begin[code]rescue[raise custom exception]end
When I raise the Exc
Here is a sample code adding a code to an error:
class MyCustomError < StandardError attr_reader :code def initialize(code) @code = code end def to_s "[#{code}] #{super}" end end
And to raise it: raise MyCustomError.new(code), message
raise MyCustomError.new(code), message