spiff-arena/SpiffWorkflow/doc/errors.rst

91 lines
2.8 KiB
ReStructuredText
Raw Normal View History

Squashed 'SpiffWorkflow/' changes from 4195453a4..1f51db962 1f51db962 Merge pull request #283 from sartography/feature/better_errors 69fb4967e Patching up some bugs and logical disconnects as I test out the errors. cf5be0096 * Making a few more things consistent in the error messages -- so there isn't filename for validation errors, and file_name for WorkflowExceptions. Same for line_number vs sourceline. * Assure than an error_type is consistently set on exceptions. * ValidationExceptions should not bild up a detailed error message that replicates information available within it. 440ee16c8 Responding to some excellent suggestions from Elizabeth: 655e415e1 Merge pull request #282 from subhakarks/fix-workfowspec-dump 1f6d3cf4e Explain that the error happened in a pre-script or post script. 8119abd14 Added a top level SpiffWorklowException that all exceptions inherit from. Aside from a message string you can append information to these exceptions with "add_note", which is a new method that all exceptions have starting in python 3.11 Switched arguments to the WorkflowException, WorkflowTaskException - which now always takes a string message as the first argument, and named arguments thereafter to be consistent with all other error messages in Python. Consistently raise ValidationExceptions whenever we encounter an error anywhere during parsing of xml. The BPMN/WorkflowTaskExecException is removed, in favor of just calling a WorkflowTaskException. There is nothing BPMN Specific in the logic, so no need for this. Consolidated error message logic so that things like "Did you mean" just get added by default if possible. So we don't have to separately deal with that logic each time. Better Error messages for DMN (include row number as a part of the error information) 13463b5c5 fix for workflowspec dump be26100bc Merge pull request #280 from sartography/feature/remove-unused-bpmn-attributes-and-methods 23a5c1d70 remove 'entering_* methods 4e5875ec8 remove sequence flow 5eed83ab1 Merge pull request #278 from sartography/feature/remove-old-serializer 614f1c68a remove compact serializer and references e7e410d4a remove old serializer and references git-subtree-dir: SpiffWorkflow git-subtree-split: 1f51db962ccaed5810f5d0f7d76a932f056430ab
2023-01-19 15:47:07 +00:00
SpiffWorkflow Exceptions
====================================
Details about the exceptions and exception hierarchy within SpiffWorkflow
SpiffWorkflowException
----------
Base exception for all exceptions raised by SpiffWorkflow
ValidationException
----------
**Extends**
SpiffWorkflowException
Thrown during the parsing of a workflow.
**Attributes/Methods**
- **tag**: The type of xml tag being parsed
- **id**: the id attribute of the xml tag, if available.
- **name**: the name attribute of the xml tag, if available.
- **line_number**: the line number where the tag occurs.
- **file_name**: The name of the file where the error occurred.
- **message**: a human readable error message.
WorkflowException
--------
When an error occurs with a Task Specification (maybe should have been called
a SpecException)
**Extends**
SpiffWorkflowException
**Attributes/Methods**
- **sender**: The TaskSpec - the specific Task, Gateway, etc... that caused the error to happen.
- **error**: a human readable error message describing the problem.
- **get_task_trace**: Provided a specific Task, will work it's way through the workflow / sub-processes
and call activities to show where an error occurred. Useful if the error happened within a deeply nested structure (where call activities include call activities ....)
WorkflowDataException
------------------
When an exception occurs moving data between tasks and Data Objects (including
data inputs and data outputs.)
**Extends**
WorkflowException
**Attributes/Methods**
(in addition to the values in a WorkflowException)
- **task**: The specific task (not the task spec, but the actual executing task)
- **data_input**: The spec of the input variable
- **data_output**: The spec of the output variable
WorkflowTaskException
--------
**Extends**
WorkflowException
**Attributes/Methods**
(in addition to the values in a WorkflowException)
- **task**: The specific task (not the task spec, but the actual executing task)
- **error_msg**: The detailed human readable message. (conflicts with error above)
- **exception**: The original exception this wraps around.
- **line_number** The line number that contains the error
- **offset** The point in the line that caused the error
- **error_line** The content of the line that caused the error.
It will accept the line_number and error_line as arguments - if the
underlying error provided is a SyntaxError it will try to derive this
information from the error.
If this is a name error, it will attempt to calculate a did-you-mean
error_msg.
Unused / Deprecated errors
--------------------
** StorageException **
Deprecated -- Used only by the PrettyXmlSerializer - which is not under active
support.
** DeadMethodCalled **
Something related to WeakMethod -- which doesn't look to be utilized anymore.