summaryrefslogtreecommitdiff
path: root/lib/environment.rb
diff options
context:
space:
mode:
authorMartin Gütlein <martin.guetlein@gmail.com>2010-04-28 10:21:35 +0200
committerMartin Gütlein <martin.guetlein@gmail.com>2010-04-28 10:21:35 +0200
commit8439bb9b337bded4a54018c03500a15082bce6b0 (patch)
tree2b573ca60a14017be203233b68354e5895aa64e5 /lib/environment.rb
parent60ee47624583411db004bf3601491320dabe588e (diff)
adjust to new task api (201)
Diffstat (limited to 'lib/environment.rb')
-rw-r--r--lib/environment.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/environment.rb b/lib/environment.rb
index c86d2be..b46bf19 100644
--- a/lib/environment.rb
+++ b/lib/environment.rb
@@ -45,9 +45,11 @@ before {$sinatra = self unless $sinatra}
class Sinatra::Base
# overwriting halt to log halts (!= 202)
- def halt(status,msg)
- LOGGER.error "halt "+status.to_s+" "+msg.to_s if (status != 202)
- throw :halt, [status, msg]
+ def halt(*response)
+ LOGGER.error "halt "+response.first.to_s+" "+(response.size>1 ? response[1].to_s : "") if response.first >= 300
+ # orig sinatra code:
+ response = response.first if response.length == 1
+ throw :halt, response
end
end