-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/better errors #283
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
danfunk
commented
Jan 16, 2023
•
edited
Loading
edited
- Added a top level SpiffWorklowException that all exceptions inherit from.
- All SpiffWorlfowExceptions have an add_note() function. This is a standard method for all exceptions starting in python 3.11. We'll introduce it now for all of our exceptions. In this way, as an error is raised, we can catch it, and append notes for added context. It is currently used in several places, such as to add "Did you mean...." when creating WorkflowTaskExecptions, or to tell people the error occurred in a PreScript, or say what row of a DMN Table the error happened in.
- Switched argument order in WorkflowException, WorkflowTaskException - they now always takes a string message as the first argument, and named arguments thereafter, making them more consistent with all other error messages in Python.
- Consistently raise ValidationExceptions whenever we encounter an error anywhere during parsing of xml.
- Removed The BPMN/WorkflowTaskExecException, replaced with a standard WorkflowTaskException. There is nothing BPMN Specific in the logic anymore, so it just siplified out.
- Consolidated error message logic as high up the error class hierarchy as possible. So that things like "Did you mean" just get added by default whenever possible.
- Better Error messages for DMN (include row number as a part of the error information)
- Validators now catch more general exceptions from lxml
…rom. 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) Validators now catch more general exceptions from lxml When catching errors, check to see if they are SpiffWorkflow errors already, and if so, just add a note to help provide additional context for the error.
Just wanted to double check you meant for |
jbirddog
approved these changes
Jan 17, 2023
essweine
reviewed
Jan 17, 2023
essweine
reviewed
Jan 17, 2023
essweine
reviewed
Jan 17, 2023
essweine
approved these changes
Jan 17, 2023
1) Avoid deserialization errors by setting a default to the row_number for DMN 2) Since we are updating signatures on error messages, have the WorkflowException take a "task_spec" rather than the obscure "sender"
…re 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.
SonarCloud Quality Gate failed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.