summary refs log tree commit diff
path: root/synapse/http
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2017-10-23 15:52:32 +0100
committerRichard van der Hoff <richard@matrix.org>2017-10-23 15:52:32 +0100
commiteaaabc6c4f93d49f090ef7ff930fa2739428a36f (patch)
treef5e5f3565589bc31d3dc9580608148b9d2f03a7c /synapse/http
parentMerge pull request #2566 from matrix-org/rav/media_logcontext_leak (diff)
downloadsynapse-eaaabc6c4f93d49f090ef7ff930fa2739428a36f.tar.xz
replace 'except:' with 'except Exception:'
what could possibly go wrong
Diffstat (limited to 'synapse/http')
-rw-r--r--synapse/http/matrixfederationclient.py2
-rw-r--r--synapse/http/server.py2
-rw-r--r--synapse/http/servlet.py6
-rw-r--r--synapse/http/site.py2
4 files changed, 6 insertions, 6 deletions
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py
index 8c8b7fa656..833496b72d 100644
--- a/synapse/http/matrixfederationclient.py
+++ b/synapse/http/matrixfederationclient.py
@@ -550,7 +550,7 @@ class MatrixFederationHttpClient(object):
                 length = yield _readBodyToFile(
                     response, output_stream, max_size
                 )
-        except:
+        except Exception:
             logger.exception("Failed to download body")
             raise
 
diff --git a/synapse/http/server.py b/synapse/http/server.py
index 8a27e3b422..3ca1c9947c 100644
--- a/synapse/http/server.py
+++ b/synapse/http/server.py
@@ -130,7 +130,7 @@ def wrap_request_handler(request_handler, include_metrics=False):
                             pretty_print=_request_user_agent_is_curl(request),
                             version_string=self.version_string,
                         )
-                    except:
+                    except Exception:
                         logger.exception(
                             "Failed handle request %s.%s on %r: %r",
                             request_handler.__module__,
diff --git a/synapse/http/servlet.py b/synapse/http/servlet.py
index 9a4c36ad5d..8118ee7cc2 100644
--- a/synapse/http/servlet.py
+++ b/synapse/http/servlet.py
@@ -48,7 +48,7 @@ def parse_integer_from_args(args, name, default=None, required=False):
     if name in args:
         try:
             return int(args[name][0])
-        except:
+        except Exception:
             message = "Query parameter %r must be an integer" % (name,)
             raise SynapseError(400, message)
     else:
@@ -88,7 +88,7 @@ def parse_boolean_from_args(args, name, default=None, required=False):
                 "true": True,
                 "false": False,
             }[args[name][0]]
-        except:
+        except Exception:
             message = (
                 "Boolean query parameter %r must be one of"
                 " ['true', 'false']"
@@ -162,7 +162,7 @@ def parse_json_value_from_request(request):
     """
     try:
         content_bytes = request.content.read()
-    except:
+    except Exception:
         raise SynapseError(400, "Error reading JSON content.")
 
     try:
diff --git a/synapse/http/site.py b/synapse/http/site.py
index 4b09d7ee66..cd1492b1c3 100644
--- a/synapse/http/site.py
+++ b/synapse/http/site.py
@@ -67,7 +67,7 @@ class SynapseRequest(Request):
             ru_utime, ru_stime = context.get_resource_usage()
             db_txn_count = context.db_txn_count
             db_txn_duration = context.db_txn_duration
-        except:
+        except Exception:
             ru_utime, ru_stime = (0, 0)
             db_txn_count, db_txn_duration = (0, 0)