Improving Error UX: Informative Messages and Recommendations for Migrations and Events #2586
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.
Why is this change needed?
packages/shuttle/src/example-app/db.ts
Migration error messages now include the path to the migration file, possible causes of the failure (syntax, schema incompatibility, dependencies) and recommendations for fixing it.
packages/shuttle/src/example-app/app.ts
Error messages for insert events, get max fid and database migration now include detailed context (e.g. event parameters, host, schema) as well as recommendations for next steps to fix the problem.
This will improve debugging usability and speed up problem resolution during operation and development.
Merge Checklist
Choose all relevant options below by adding an
xnow or at any time before submitting for reviewPR-Codex overview
This PR enhances error logging in the
db.tsandapp.tsfiles, providing more detailed messages for migration failures and database issues. It aims to improve debugging by including specific information related to the errors encountered.Detailed summary
db.ts, improved error messages for migration execution failures, including suggestions for troubleshooting.app.ts, refined error handling for on-chain event insertion, adding detailed context about the error and event data.