-
Notifications
You must be signed in to change notification settings - Fork 1
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
Nested/chained error API #36
Labels
feature
A new functionality
Comments
Perhaps this is the time for advertising. Because Tarantool core since 2.4 support something similar. tarantool> e = box.error.new('MyErrorType', 'Message')
---
...
tarantool> error(e)
---
- error: Message
...
tarantool> e.type
---
- MyErrorType
...
tarantool> e.trace
---
- - file: '[string "e = box.error.new(''MyErrorType'', ''Message'')"]'
line: 1
... Also such errors could be stacked: tarantool> reason = box.error.new('MyErrorType', 'Reason')
---
...
tarantool> e:set_prev(reason)
---
...
tarantool> e.prev
---
- Reason
...
tarantool> e.prev.prev
---
- null
... |
Not planned. |
From the triage meeting: there are some plans to dramatically improve error framework in tarantool. @unera knows more. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reason
For a better understanding of where the error occurred, it is desirable to have some kind of interface where you could get a nested error. A specific example of use can be found here tarantool/crud#186.
It will be inconvenient to catch errors if there is a high level of nesting. For example (vshard -> crud -> cartridge-java -> client-app) each of these api can throw an error, catch it and generate a new one, so it will be difficult to find out what the original error was.
Examples from other languages
The functionality of nested/chained errors is implemented in other languages:
The text was updated successfully, but these errors were encountered: