Skip to content
1 change: 1 addition & 0 deletions changes/6492.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Introduce `BaseMinilangFilterConverter` and `BaseMinilangOrderParser` abstract base classes for converting minilang filter expressions and order strings to domain-specific Filter and OrderingOption objects
52 changes: 52 additions & 0 deletions src/ai/backend/common/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,3 +790,55 @@ def error_code(cls) -> ErrorCode:
operation=ErrorOperation.READ,
error_detail=ErrorDetail.NOT_FOUND,
)


class InvalidParameter(BackendAIError, web.HTTPBadRequest):
error_type = "https://api.backend.ai/probs/invalid-parameter"
error_title = "Invalid Parameter"

@classmethod
def error_code(cls) -> ErrorCode:
return ErrorCode(
domain=ErrorDomain.BACKENDAI,
operation=ErrorOperation.REQUEST,
error_detail=ErrorDetail.BAD_REQUEST,
)


class ASTParsingFailed(BackendAIError, web.HTTPBadRequest):
error_type = "https://api.backend.ai/probs/ast-parsing-failed"
error_title = "AST Parsing Failed"

@classmethod
def error_code(cls) -> ErrorCode:
return ErrorCode(
domain=ErrorDomain.BACKENDAI,
operation=ErrorOperation.PARSING,
error_detail=ErrorDetail.BAD_REQUEST,
)


class UnsupportedOperation(BackendAIError, web.HTTPBadRequest):
error_type = "https://api.backend.ai/probs/unsupported-operation"
error_title = "Unsupported Operation"

@classmethod
def error_code(cls) -> ErrorCode:
return ErrorCode(
domain=ErrorDomain.BACKENDAI,
operation=ErrorOperation.REQUEST,
error_detail=ErrorDetail.BAD_REQUEST,
)


class UnsupportedFieldType(BackendAIError, web.HTTPBadRequest):
error_type = "https://api.backend.ai/probs/unsupported-field-type"
error_title = "Unsupported Field Type"

@classmethod
def error_code(cls) -> ErrorCode:
return ErrorCode(
domain=ErrorDomain.BACKENDAI,
operation=ErrorOperation.REQUEST,
error_detail=ErrorDetail.BAD_REQUEST,
)
Loading
Loading