Sha256: abbcd453f5adddeec61dc862ef4e8207e029b38fc627fd823d197050a9c7acdb
Contents?: true
Size: 759 Bytes
Versions: 11
Compression:
Stored size: 759 Bytes
Contents
module Nestene class ExecutionError include StructureMapper::Hash def initialize(exception = nil) if exception self.message = exception.message self.type = exception.class.name self.backtrace = exception.backtrace end end attribute message: String attribute type: String attribute backtrace: [String] def to_exception exception = Nestene.class_from_string(type).new(message) exception.set_backtrace self.backtrace exception end end end class Exception def to_structure Nestene::ExecutionError.new(self).to_structure end def self.from_structure structure structure ? Nestene::ExecutionError.from_structure(structure).to_exception : nil end end
Version data entries
11 entries across 11 versions & 1 rubygems