summaryrefslogtreecommitdiff
path: root/lib/error.rb
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2011-01-26 15:54:05 +0100
committermguetlein <martin.guetlein@gmail.com>2011-01-26 15:54:05 +0100
commitce93b07bb253df3c548c59bacc869839aa78bb4c (patch)
tree49089ce84a319fb46136fb4e4f0f4407ee7b1fb3 /lib/error.rb
parent2528891633d838a383f5a0e07712a0a8ee839f32 (diff)
add whitlisting concept for A&A, some minor modifications
Diffstat (limited to 'lib/error.rb')
-rw-r--r--lib/error.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/error.rb b/lib/error.rb
index e5c460d..8c666f3 100644
--- a/lib/error.rb
+++ b/lib/error.rb
@@ -39,7 +39,7 @@ 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]
+ @backtrace = error.backtrace.short_backtrace if CONFIG[:backtrace]
end
# overwrite sorting to make easier readable
@@ -72,4 +72,15 @@ module OpenTox
s.to_rdfxml
end
end
+end
+
+class Array
+ def short_backtrace
+ short = []
+ each do |c|
+ break if c =~ /sinatra\/base/
+ short << c
+ end
+ short.join("\n")
+ end
end \ No newline at end of file