diff options
author | Martin Gütlein <martin.guetlein@gmail.com> | 2010-04-19 17:48:45 +0200 |
---|---|---|
committer | Martin Gütlein <martin.guetlein@gmail.com> | 2010-04-19 17:48:45 +0200 |
commit | 429a21a3aed47afa63a1c6963d41efc4322a3e5d (patch) | |
tree | a81e2b898052e5b5d1ee372da84b939541a66b8e /lib | |
parent | f4234893c238d298c09e921208c5431287899f8e (diff) |
make sure halt is caught
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rest_client_wrapper.rb | 14 |
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 |