summaryrefslogtreecommitdiff
path: root/lib/rest_client_wrapper.rb
diff options
context:
space:
mode:
authorMartin Gütlein <martin.guetlein@gmail.com>2010-04-19 17:48:45 +0200
committerMartin Gütlein <martin.guetlein@gmail.com>2010-04-19 17:48:45 +0200
commit429a21a3aed47afa63a1c6963d41efc4322a3e5d (patch)
treea81e2b898052e5b5d1ee372da84b939541a66b8e /lib/rest_client_wrapper.rb
parentf4234893c238d298c09e921208c5431287899f8e (diff)
make sure halt is caught
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