Skip to content

feat : add specific error for connection target#104

Merged
pmpetit merged 1 commit into
mainfrom
fix/cx_message_error
Jul 7, 2026
Merged

feat : add specific error for connection target#104
pmpetit merged 1 commit into
mainfrom
fix/cx_message_error

Conversation

@pmpetit

@pmpetit pmpetit commented Jul 6, 2026

Copy link
Copy Markdown
Owner

This pull request introduces explicit backend attribution for connection-related errors in the mongo2pg CLI tool, improving error diagnostics for MongoDB, PostgreSQL, and Kafka. The changes ensure that user-facing error messages and runtime logs consistently identify which backend failed and in what operation context, while preserving the original error details for troubleshooting. This enhancement covers all major command paths and updates both error handling and logging.

Connection error attribution and diagnostics:

  • Added a shared helper function connection_failed_context in src/bin/mongo2pg.rs to generate standardized error context strings for connection failures, specifying backend and operation.
  • Updated MongoDB, PostgreSQL, and Kafka connection and operation error handling in all relevant command paths (infer, export, import, report, kafka-import) to wrap errors with explicit backend attribution using the new helper and anyhow::Context. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Specification and requirements:

  • Added new and updated specs for connection-error-attribution and runtime-log-format, defining requirements for backend-specific error attribution, root cause preservation, and consistent log formatting. [1] [2] [3] [4]
  • Documented design decisions, goals, risks, and migration plan in design.md and proposal.md for the new error attribution approach. [1] [2]

Verification and tasks:

  • Updated the project tasks to reflect inventory, implementation, logging, and verification steps for backend error attribution and log consistency.

Metadata:

  • Added a new change archive entry for tracking this feature.

These changes make it much easier for users and operators to quickly identify which backend failed and why, reducing troubleshooting time and improving reliability.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Preview build ready

Binaries for commit 84b34a3 are available at:
https://github.com/pmpetit/mongo2pg/releases/tag/pr-104-preview

This release is updated on every push and deleted when the PR is closed.

@pmpetit pmpetit merged commit a6ec78d into main Jul 7, 2026
7 checks passed
@pmpetit pmpetit deleted the fix/cx_message_error branch July 7, 2026 05:03
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.

1 participant