[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [flashproxy/master] Don't catch SystemExit in catch-all exceptions.



commit fb511b3850dcbdd823a5caed0544064d91f853b6
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Mon May 20 12:21:38 2013 -0700

    Don't catch SystemExit in catch-all exceptions.
    
    exit_error raises SystemExit. This was causing the exception handler for
    exit_error(400) to print another "Status: 500" in the response body.
---
 facilitator/facilitator.cgi |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/facilitator/facilitator.cgi b/facilitator/facilitator.cgi
index 4885ead..266905d 100755
--- a/facilitator/facilitator.cgi
+++ b/facilitator/facilitator.cgi
@@ -43,7 +43,7 @@ def url_reg(reg):
             output_status(204)
         else:
             exit_error(400)
-    except:
+    except Exception:
         exit_error(500)
 
 def do_head():
@@ -60,7 +60,7 @@ def do_get():
     elif len(path_parts) == 0:
         try:
             reg = fac.get_reg(FACILITATOR_ADDR, remote_addr) or ""
-        except:
+        except Exception:
             exit_error(500)
         # Allow XMLHttpRequest from any domain. http://www.w3.org/TR/cors/.
         print """\

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits