mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 02:17:19 +00:00
JsonableError: Make http_status_code a class attribute only.
This simplifies things for all codepaths not involving this feature. Using this feature becomes slightly easier when you're already defining a subclass, but now requires you to define a subclass. Currently we use it just once out of >100 uses of JsonableError, and that use already has a subclass, so this seems like a win.
This commit is contained in:
@@ -7,10 +7,9 @@ class JsonableError(Exception):
|
||||
msg = None # type: Text
|
||||
http_status_code = 400 # type: int
|
||||
|
||||
def __init__(self, msg, http_status_code=400):
|
||||
# type: (Text, int) -> None
|
||||
def __init__(self, msg):
|
||||
# type: (Text) -> None
|
||||
self.msg = msg
|
||||
self.http_status_code = http_status_code
|
||||
|
||||
def __str__(self):
|
||||
# type: () -> str
|
||||
|
||||
Reference in New Issue
Block a user