diff options
author | mguetlein <martin.guetlein@gmail.com> | 2011-01-25 12:50:41 +0100 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2011-01-25 12:50:41 +0100 |
commit | b8e919f933b4137043c6facf56b5ad20249fdd2b (patch) | |
tree | 433e8b2c951a73b6bb32b22fb768fdaecf54ee14 | |
parent | 8cfe8ad608e59d3536cd5403a70743a51cb901ee (diff) |
add backtrace to error if configured in .yaml config
-rw-r--r-- | lib/error.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/error.rb b/lib/error.rb index d3fd19b..e5c460d 100644 --- a/lib/error.rb +++ b/lib/error.rb @@ -39,6 +39,15 @@ module OpenTox @actor = actor @errorCause = error.errorCause if error.errorCause @rest_params = error.rest_params if error.is_a?(OpenTox::RestCallError) and error.rest_params + @backtrace = error.backtrace.join("\n") if CONFIG[:backtrace] + end + + # overwrite sorting to make easier readable + def to_yaml_properties + p = super + p = ( p - ["@backtrace"]) + ["@backtrace"] if @backtrace + p = ( p - ["@errorCause"]) + ["@errorCause"] if @errorCause + p end def rdf_content() |