-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Bcfr 945 improve contract reader logs #14546
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about wrapping errors with extra detail all the way up to the beginning of the stack, instead of logging them at the origin? So we would get something like this "failed to get latest value for xy at address xy ,err: failed to convert params xy to nativeOnchainTypes, err: failed to create codec type for item type xy"
Then, if it's a user input error, simply return it, but if it's an internal error, log it and return a generic internal error message. The goal is to make debugging this without opening up a debugger possible 😆
cc @jmank88 not sure how we usually do this
That is why I tried adding a lot more information about each error to give better hints at where the error occurred in the call stack. Everything is a read error, but each error gets a bit more detail as it moves down the stack and also picks up input parameters as well. My main concern is security of printing some of the call parameters and return values to logs. That is what it is doing right now. |
3b0be6b
to
928bf11
Compare
WF: CI Core#285b64eNo errors found in this run. 🎉 |
928bf11
to
b054e61
Compare
8699cb0
to
0ef90eb
Compare
192c823
to
cdfbba7
Compare
6cfe9fb
to
c6ee63f
Compare
c6ee63f
to
8b47983
Compare
WF: CI Core#4b320f2No errors found in this run. 🎉 |
ce901b9
to
1ab6fe4
Compare
WF: CI Core#1ab6fe4No errors found in this run. 🎉 |
Co-authored-by: Jordan Krage <[email protected]>
1ab6fe4
to
58db544
Compare
WF: CI Core#58db544No errors found in this run. 🎉 |
WF: CI Core#4d57495No errors found in this run. 🎉 |
WF: CI Core#9da225cNo errors found in this run. 🎉 |
WF: CI Core#b4fdafbNo errors found in this run. 🎉 |
WF: CI Core#5bfecd1No errors found in this run. 🎉 |
Quality Gate passedIssues Measures |
BCFR-945 improve logs and error handling for contract reader
All errors are structured as a
ReadError
with extra detail on the contract, method/event, parameters, etc. This data is now provided in the debug log.