-
Notifications
You must be signed in to change notification settings - Fork 177
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
Add backtrace to forge #2679
base: master
Are you sure you want to change the base?
Add backtrace to forge #2679
Conversation
fdd8f68
to
b9666d3
Compare
This was inspired by Rust backtrace, but there are a couple of things to note in terms of user experience. When Forge encounters an error, it suggests enabling a backtrace for more context:
Enabling backtrace provides a call stack:
However ...
In terms of UX, if you prefer something different, we can easily change this as the backend will probably stay the same. |
Also, I will add documentation in a separate PR to avoid making this one any bigger. |
"perhaps the contract was compiled without the following entry in Scarb.toml under [profile.dev.cairo]: | ||
unstable-add-statements-code-locations-debug-info = true | ||
|
||
or scarb version is less than 2.8.0 |
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.
This can be a follow up task: Can we explicitly check both Scarb version and toml for these keys and show to the users the things that are incorrect?
So it outputs an error like: unstable-add-statements-code-locations-debug-info = true in Scarb.toml for backtrace to work
or scarb version must be at least 2.8.0
etc?
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.
Good job 👌
Closes #2468
Introduced changes
Checklist
CHANGELOG.md