From b3bcacf3c1c72bfadeb46fe4d0198ca155a8c615 Mon Sep 17 00:00:00 2001 From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Date: Thu, 9 Dec 2021 12:23:34 +0100 Subject: Add missing `errcode` to `parse_string` and `parse_boolean` (#11542) --- synapse/http/servlet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'synapse/http/servlet.py') diff --git a/synapse/http/servlet.py b/synapse/http/servlet.py index 6dd9b9ad03..1627225f28 100644 --- a/synapse/http/servlet.py +++ b/synapse/http/servlet.py @@ -246,7 +246,7 @@ def parse_boolean_from_args( message = ( "Boolean query parameter %r must be one of ['true', 'false']" ) % (name,) - raise SynapseError(400, message) + raise SynapseError(400, message, errcode=Codes.INVALID_PARAM) else: if required: message = "Missing boolean query parameter %r" % (name,) @@ -414,7 +414,7 @@ def _parse_string_value( name, ", ".join(repr(v) for v in allowed_values), ) - raise SynapseError(400, message) + raise SynapseError(400, message, errcode=Codes.INVALID_PARAM) else: return value_str -- cgit 1.4.1