Improve database loading/connection error logs#256
Merged
jamescmartinez merged 1 commit intomainfrom Feb 5, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves database connection error messages to provide clearer, more actionable feedback when database connections fail, especially helpful during initial project setup.
Changes:
- Added a new
wrapErrorutility function to wrap errors with clearer messages while preserving original error details - Enhanced SQLite and Postgres backend connection methods to catch and wrap connection errors with helpful guidance
- Added comprehensive test coverage for the new error handling behavior
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/openworkflow/core/error.ts | Added wrapError function to create wrapped errors with preserved causes |
| packages/openworkflow/core/error.test.ts | Added tests for wrapError function with Error and string inputs |
| packages/openworkflow/sqlite/backend.ts | Wrapped database connection errors with helpful messages about path validity |
| packages/openworkflow/sqlite/backend.test.ts | Added test to verify helpful error messages for invalid database paths |
| packages/openworkflow/postgres/backend.ts | Wrapped connection errors with helpful messages including URL format examples |
| packages/openworkflow/postgres/backend.test.ts | Added test to verify helpful error messages for invalid connection URLs |
e32fbcf to
9014661
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR improves db error messages. This is most obvious when setting up a new project and a DB connection string is invalid.