diff --git a/src/schema_registry/routers/errors.py b/src/schema_registry/routers/errors.py index 18c80299d..7fe8e1a63 100644 --- a/src/schema_registry/routers/errors.py +++ b/src/schema_registry/routers/errors.py @@ -3,13 +3,13 @@ See LICENSE for details """ -from enum import Enum, unique +from enum import IntEnum, StrEnum, unique from fastapi import HTTPException, status from fastapi.exceptions import RequestValidationError @unique -class SchemaErrorCodes(Enum): +class SchemaErrorCodes(IntEnum): HTTP_BAD_REQUEST = status.HTTP_400_BAD_REQUEST HTTP_NOT_FOUND = status.HTTP_404_NOT_FOUND HTTP_CONFLICT = status.HTTP_409_CONFLICT @@ -34,7 +34,7 @@ class SchemaErrorCodes(Enum): @unique -class SchemaErrorMessages(Enum): +class SchemaErrorMessages(StrEnum): SUBJECT_NOT_FOUND_FMT = "Subject '{subject}' not found." INVALID_COMPATIBILITY_LEVEL = ( "Invalid compatibility level. Valid values are none, backward, "