Exception: Exception

Defined in:
lib/ext/exception.rb

Overview

Extend the Exception class to add a method for serializing error details.

Instance Method Summary collapse

Instance Method Details

#mv_serialize_errorHash

Serialize the exception into a hash with message, class, and backtrace.

Returns:

  • (Hash)

    serialized error details



13
14
15
16
17
18
19
# File 'lib/ext/exception.rb', line 13

def mv_serialize_error
  {
    message: message,
    class: self.class.name,
    backtrace: Array(backtrace)
  }
end