Add modifiers for error code and class (#576) #579
Merged
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.
Arguably the most naive / liberal way to allow for custom errors. There might be reasons to only allow a subset of the error codes / classes, but I can't make up my mind which ones that should be. If that's the case, perhaps a set of specialised constructors would be preferrable, otherwise I'd lean towards amending this to define a
new
constructor which takes the code and class directly.Aside: I noticed that the
ErrorCode
enum is missing some possible values from the binding. I'll submit that separately.