summaryrefslogtreecommitdiff
path: root/lib/rest_client_wrapper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rest_client_wrapper.rb')
-rw-r--r--lib/rest_client_wrapper.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/rest_client_wrapper.rb b/lib/rest_client_wrapper.rb
index 1532a79..a70da98 100644
--- a/lib/rest_client_wrapper.rb
+++ b/lib/rest_client_wrapper.rb
@@ -143,11 +143,15 @@ module OpenTox
# return error (by halting, halts should be logged)
# PENDING always return yaml for now
- if defined?(halt)
- halt(502,error.to_yaml)
- elsif defined?($sinatra)
- $sinatra.halt(502,error.to_yaml)
- else
+ begin
+ if defined?(halt)
+ halt(502,error.to_yaml)
+ elsif defined?($sinatra)
+ $sinatra.halt(502,error.to_yaml)
+ else
+ raise ""
+ end
+ rescue
raise error.to_yaml
end
end