Implement FileURLParserBlock and FILE_URL WorkflowParameterType (#559)

This commit is contained in:
Kerem Yilmaz 2024-07-05 17:08:20 -07:00 committed by GitHub
parent 8be94d7928
commit 6929a1d24d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 135 additions and 19 deletions

View file

@ -75,3 +75,11 @@ class ContextParameterSourceNotDefined(BaseWorkflowHTTPException):
f"Source parameter key {source_key} for context parameter {context_parameter_key} does not exist.",
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
)
class InvalidFileType(BaseWorkflowHTTPException):
def __init__(self, file_url: str, file_type: str, error: str) -> None:
super().__init__(
f"File URL {file_url} is not a valid {file_type} file. Error: {error}",
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
)