Skip to content

Improve database loading/connection error logs#256

Merged
jamescmartinez merged 1 commit intomainfrom
improve-db-errors
Feb 5, 2026
Merged

Improve database loading/connection error logs#256
jamescmartinez merged 1 commit intomainfrom
improve-db-errors

Conversation

@jamescmartinez
Copy link
Copy Markdown
Contributor

Summary

This PR improves db error messages. This is most obvious when setting up a new project and a DB connection string is invalid.

Copilot AI review requested due to automatic review settings February 5, 2026 19:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 wrapError utility 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

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jamescmartinez jamescmartinez merged commit 5a0a0fc into main Feb 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants