<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,5 @@
 == 0.8.1 Rebel Porpoise release
+ * [bug] Rescue all types of errors when processing request, fixes #62
  * [bug] Use Swiftiply backend when -y option is specified, fixes #63 and #64
  * Allow passing port as a string in Server.new
  * Define deferred?(env) in your Rack application to set if a request is handled in a</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -57,7 +57,7 @@ module Thin
       
       # Process the request calling the Rack adapter
       @app.call(@request.env)
-    rescue
+    rescue Object
       handle_error
       terminate_request
       nil # Signal to post_process that the request could not be processed
@@ -80,7 +80,7 @@ module Thin
       # If no more request on that same connection, we close it.
       close_connection_after_writing unless persistent?
       
-    rescue
+    rescue Object
       handle_error
     ensure
       terminate_request
@@ -133,7 +133,7 @@ module Thin
     # IP Address of the remote client.
     def remote_address
       @request.forwarded_for || socket_address
-    rescue
+    rescue Object
       log_error
       nil
     end</diff>
      <filename>lib/thin/connection.rb</filename>
    </modified>
    <modified>
      <diff>@@ -30,6 +30,16 @@ describe Connection do
     @connection.process
   end
   
+  it &quot;should rescue error in process&quot; do
+    @connection.app.should_receive(:call).and_raise(StandardError)
+    @connection.process
+  end
+  
+  it &quot;should rescue Timeout error in process&quot; do
+    @connection.app.should_receive(:call).and_raise(Timeout::Error.new(&quot;timeout error not rescued&quot;))
+    @connection.process
+  end
+  
   it &quot;should return HTTP_X_FORWARDED_FOR as remote_address&quot; do
     @connection.request.env['HTTP_X_FORWARDED_FOR'] = '1.2.3.4'
     @connection.remote_address.should == '1.2.3.4'</diff>
      <filename>spec/connection_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>79f2a3257732004d06131172359688202b0362aa</id>
    </parent>
  </parents>
  <author>
    <name>macournoyer</name>
    <email>macournoyer@gmail.com</email>
  </author>
  <url>http://github.com/macournoyer/thin/commit/a9acdec985583b0a9dd539417634b2c0eaee3b40</url>
  <id>a9acdec985583b0a9dd539417634b2c0eaee3b40</id>
  <committed-date>2008-04-18T19:38:06-07:00</committed-date>
  <authored-date>2008-04-18T19:38:06-07:00</authored-date>
  <message>Rescue all types of errors when processing request
[#62 state:resolved]</message>
  <tree>ea57a017e9209cb4dfbc02feb884715c5e1e7e92</tree>
  <committer>
    <name>macournoyer</name>
    <email>macournoyer@gmail.com</email>
  </committer>
</commit>
