Backward compatibility helper for write command error handling.
(result: Mapping[str, Any])
| 315 | |
| 316 | |
| 317 | def _check_write_command_response(result: Mapping[str, Any]) -> None: |
| 318 | """Backward compatibility helper for write command error handling.""" |
| 319 | # Prefer write errors over write concern errors |
| 320 | write_errors = result.get("writeErrors") |
| 321 | if write_errors: |
| 322 | _raise_last_write_error(write_errors) |
| 323 | |
| 324 | wce = _get_wce_doc(result) |
| 325 | if wce: |
| 326 | _raise_write_concern_error(wce) |
| 327 | |
| 328 | |
| 329 | def _fields_list_to_dict( |