Commit cb1e01e
committed
wip(drivers): give the uncompilable-filter refusal an ADR-0112 code and drop the driver prefix (#4436)
IN PROGRESS — code change complete, regression test not yet written and the
real-boot curl repro not yet run.
A filter carrying an operator the driver cannot compile is already REFUSED
rather than silently matched (#4209/#4029), but the refusal had no wire
identity: the thrown `Error` carried no `code`, so `mapDataError`'s default
branch served `{"error": "[sql-driver] Unsupported filter operator …"}` — no
`error.code` at all, breaking the ADR-0112 contract every sibling rejection on
the same route already honours (`INVALID_FIELD`, `INVALID_FILTER`,
`RECORD_NOT_FOUND`), and leaking the `[sql-driver]` internal prefix that the
#3867 sanitiser exists to keep off the wire.
Both drivers now throw through a local `unsupportedFilterError` that stamps
`code = StandardErrorCode.enum.INVALID_FILTER` (the same catalogued code
`metadata-protocol` emits when a filter fails to parse upstream — one
condition, one wire code however the caller reached it) and `status = 400`,
which also puts the rejection on `isExpectedQueryRejection` so a client mistake
stops being logged as an unhandled server error. The internal prefix is gone
from the message; the actionable operator/field/vocabulary detail stays.
Applied to every filter-COMPILATION refusal in both backends, not just the one
branch the issue names — they are the same envelope defect on adjacent lines,
and #3948 made the two drivers agree that an uncompilable filter is a refusal,
so their refusal envelopes have to agree too.
TODO: regression tests (driver-sql, driver-memory, REST envelope) + boot repro.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017gEHJN2NFpS9VMeURvakgD1 parent f566a1d commit cb1e01e
2 files changed
Lines changed: 67 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
15 | 34 | | |
16 | 35 | | |
17 | 36 | | |
| |||
764 | 783 | | |
765 | 784 | | |
766 | 785 | | |
767 | | - | |
768 | | - | |
| 786 | + | |
| 787 | + | |
769 | 788 | | |
770 | 789 | | |
771 | 790 | | |
| |||
785 | 804 | | |
786 | 805 | | |
787 | 806 | | |
788 | | - | |
789 | | - | |
| 807 | + | |
| 808 | + | |
790 | 809 | | |
791 | 810 | | |
792 | 811 | | |
| |||
874 | 893 | | |
875 | 894 | | |
876 | 895 | | |
877 | | - | |
878 | | - | |
| 896 | + | |
| 897 | + | |
879 | 898 | | |
880 | 899 | | |
881 | 900 | | |
882 | 901 | | |
883 | 902 | | |
884 | 903 | | |
885 | | - | |
886 | | - | |
| 904 | + | |
| 905 | + | |
887 | 906 | | |
888 | 907 | | |
889 | 908 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
378 | 379 | | |
379 | 380 | | |
380 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
381 | 416 | | |
382 | 417 | | |
383 | 418 | | |
| |||
5259 | 5294 | | |
5260 | 5295 | | |
5261 | 5296 | | |
5262 | | - | |
| 5297 | + | |
5263 | 5298 | | |
5264 | 5299 | | |
5265 | 5300 | | |
| |||
5298 | 5333 | | |
5299 | 5334 | | |
5300 | 5335 | | |
5301 | | - | |
5302 | | - | |
| 5336 | + | |
| 5337 | + | |
5303 | 5338 | | |
5304 | 5339 | | |
5305 | 5340 | | |
| |||
5472 | 5507 | | |
5473 | 5508 | | |
5474 | 5509 | | |
5475 | | - | |
5476 | | - | |
| 5510 | + | |
| 5511 | + | |
5477 | 5512 | | |
5478 | 5513 | | |
5479 | 5514 | | |
| |||
0 commit comments