Skip to content

Commit 0e62c4c

Browse files
committed
Issue #195 update some error classes (changed descriptions)
1 parent 74ceb73 commit 0e62c4c

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

openeo_driver/errors.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ class ProcessGraphMissingException(OpenEOApiException):
360360
status_code = 400
361361
code = 'ProcessGraphMissing'
362362
message = "Invalid process specified. It doesn't contain a process graph."
363-
_description = "The parameter `process` doesn't contain a valid process."
363+
_description = "The process doesn't contain a process graph. For jobs, services, and sync. processing the parameter `process` must contain a `process_graph`."
364364
_tags = ['Batch Jobs', 'Data Processing', 'Secondary Services', 'User-Defined Processes']
365365

366366

@@ -442,19 +442,19 @@ class ProcessUnsupportedException(OpenEOApiException):
442442
status_code = 400
443443
code = 'ProcessUnsupported'
444444
message = "Process with identifier '{process}' is not available in namespace '{namespace}'."
445-
_description = 'A process (pre-defined or user-defined) with the specified identifier is not available. To be used when validating or executing process graphs.'
446-
_tags = ['Data Processing']
445+
_description = "A process (predefined or user-defined) with the specified identifier is not available. To be used when validating or executing process graphs."
446+
_tags = ["Data Processing"]
447447

448448
def __init__(self, process: str, namespace: str = "backend"):
449449
super().__init__(message=self.message.format(process=process, namespace=namespace))
450450

451451

452452
class PredefinedProcessExistsException(OpenEOApiException):
453453
status_code = 400
454-
code = 'PredefinedProcessExists'
455-
message = 'A predefined process with the given identifier exists.'
456-
_description = 'If a user wants to store a user-defined process with the id of a pre-defined process.'
457-
_tags = ['User-Defined Processes']
454+
code = "PredefinedProcessExists"
455+
message = "A predefined process with the given identifier exists."
456+
_description = "If a user wants to store a user-defined process with the id of a predefined process."
457+
_tags = ["User-Defined Processes"]
458458

459459

460460
class ProcessParameterRequiredException(OpenEOApiException):

tests/test_errors.py

+2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ def test_error_code(error_code):
8484
raise Exception("Exception class {c} has placeholder in message but no custom __init__".format(
8585
c=exception_cls.__name__))
8686

87+
assert exception_cls._description == error_spec["description"]
88+
8789

8890
def test_flask_request_id_as_api_error_id():
8991
app = flask.Flask(__name__)

0 commit comments

Comments
 (0)