from enum import Flag class ErrorCodes(Flag): INTERNAL_SERVER_ERROR = (500, "internal server error") REQUEST_VALIDATION_ERROR = (400, "request validation error") JWT_VALIDATION_ERROR = (401, "jwt validation error") TEXT_VALIDATION_ERROR = (490, "text validation error") OTHER_ERROR = (999, "other error")