Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 5e38930

Browse files
committed
WIP: Applied feedback
1 parent 4657d28 commit 5e38930

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

changelog.d/12703.misc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Introduce a string enum `Code` to replace the namespace class `Codes`.
1+
Convert namespace class `Codes` into a string enum.

synapse/api/errors.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
logger = logging.getLogger(__name__)
3232

3333

34-
class Code(str, Enum):
34+
class Codes(str, Enum):
3535
"""
3636
All known error codes, as an enum of strings.
3737
"""
@@ -93,11 +93,6 @@ def __repr__(self) -> str:
9393
UNREDACTED_CONTENT_DELETED = "FI.MAU.MSC2815_UNREDACTED_CONTENT_DELETED"
9494

9595

96-
# `Codes` used to be a namespace for codes. This is now replaced
97-
# with the enum `Code` but we maintain it for backwards compatibility.
98-
Codes = Code
99-
100-
10196
class CodeMessageException(RuntimeError):
10297
"""An exception with integer code and message string attributes.
10398

0 commit comments

Comments
 (0)