about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/rainbows/rev.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/rainbows/rev.rb b/lib/rainbows/rev.rb
index 8381975..7e5ca27 100644
--- a/lib/rainbows/rev.rb
+++ b/lib/rainbows/rev.rb
@@ -55,6 +55,7 @@ module Rainbows
       end
 
       def handle_error(e)
+        @state = :close
         msg = case e
         when EOFError,Errno::ECONNRESET,Errno::EPIPE,Errno::EINVAL,Errno::EBADF
           ERROR_500_RESPONSE
@@ -66,8 +67,6 @@ module Rainbows
           ERROR_500_RESPONSE
         end
         write(msg)
-        ensure
-          @state = :close
       end
 
       def app_call