lib/hoth/extension/core/exception.rb in hoth-0.3.3 vs lib/hoth/extension/core/exception.rb in hoth-0.3.4
- old
+ new
@@ -1,15 +1,19 @@
class Exception
def to_json(*params)
+ as_json(*params).to_json(*params)
+ end
+
+ def as_json(*params)
{
'json_class' => self.class.name,
'message' => self.message,
'backtrace' => self.backtrace
- }.to_json(*params)
+ }
end
-
+
def self.json_create(hash)
exception = new(hash["message"])
exception.set_backtrace hash['backtrace']
exception
end
-end
\ No newline at end of file
+end