-
Notifications
You must be signed in to change notification settings - Fork 543
Open
Labels
enhancementThe issue is a request for improvement or a new featureThe issue is a request for improvement or a new featurestatus-triageIssue is under initial triageIssue is under initial triage
Description
I believe I've found an inconsistency in the connector’s structured error-handling flow and wanted maintainer feedback before opening a PR.
The connection/cursor errorhandler typing is looser and less explicit than the structured Error-based contract used in errors.py. There is also a mismatch in the ready-exception path: generic Python exceptions can be routed into the structured handler flow even though that flow expects structured error details rather than Exception.args-style payloads.
I prepared a branch with a proposed fix:
- branch:
typing-errorhandler-protocol
The change does the following:
- introduces a shared structured payload type for error-handler details
- introduces a shared structured handler protocol
- aligns
connection.pyandcursor.pywith that structured contract - narrows the structured path to
Errorsubclasses - updates the ready-exception wrapper so generic exceptions are re-raised instead of being routed into the dict-based structured handler flow
- adds unit tests for the structured and ready-exception paths
Before opening the PR, I wanted to confirm:
- whether maintainers agree this should be treated as an internal bug/consistency fix
- whether narrowing the structured path to
Errorsubclasses is the right direction - whether this should go in as one PR or be split into smaller pieces
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementThe issue is a request for improvement or a new featureThe issue is a request for improvement or a new featurestatus-triageIssue is under initial triageIssue is under initial triage