Skip to content

Conversation

@aashishpatil-g
Copy link
Collaborator

This change enhances error handling for DataConnect operations by introducing specific error codes within DataConnectOperationError.

Key changes:

  • Added DataConnectOperationError.Code enum with uniqueConstraintFailed and genericOperationError cases.
  • DataConnectOperationError now stores and exposes an instance of this code.
  • Updated GrpcClient to throw DataConnectOperationError with the .uniqueConstraintFailed code when a unique constraint violation is detected during a mutation and the backend error message contains relevant keywords.
  • Other operational failures resulting in DataConnectOperationError will use the .genericOperationError code.

This provides developers with a more granular way to identify and handle specific operation failures, particularly unique constraint violations.

(Note: Unit test file was removed as per user request.)

This change enhances error handling for DataConnect operations by introducing specific error codes within `DataConnectOperationError`.

Key changes:
- Added `DataConnectOperationError.Code` enum with `uniqueConstraintFailed` and `genericOperationError` cases.
- `DataConnectOperationError` now stores and exposes an instance of this code.
- Updated `GrpcClient` to throw `DataConnectOperationError` with the `.uniqueConstraintFailed` code when a unique constraint violation is detected during a mutation and the backend error message contains relevant keywords.
- Other operational failures resulting in `DataConnectOperationError` will use the `.genericOperationError` code.

This provides developers with a more granular way to identify and handle specific operation failures, particularly unique constraint violations.

(Note: Unit test file was removed as per user request.)
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