Commit 698ac3d
committed
Feat: Introduce specific error codes for DataConnectOperationError
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.)1 parent 9ff6f43 commit 698ac3d
2 files changed
+59
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
202 | 217 | | |
203 | | - | |
| 218 | + | |
204 | 219 | | |
205 | 220 | | |
206 | 221 | | |
207 | 222 | | |
208 | | - | |
| 223 | + | |
209 | 224 | | |
| 225 | + | |
210 | 226 | | |
211 | 227 | | |
212 | 228 | | |
| |||
215 | 231 | | |
216 | 232 | | |
217 | 233 | | |
218 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
219 | 243 | | |
220 | 244 | | |
221 | 245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
198 | 214 | | |
199 | 215 | | |
200 | 216 | | |
201 | 217 | | |
202 | 218 | | |
203 | 219 | | |
204 | 220 | | |
205 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
206 | 227 | | |
207 | 228 | | |
208 | 229 | | |
| |||
283 | 304 | | |
284 | 305 | | |
285 | 306 | | |
286 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
287 | 316 | | |
288 | 317 | | |
289 | 318 | | |
| |||
0 commit comments