We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 746ca4f commit c055ef6Copy full SHA for c055ef6
1 file changed
.changeset/rest-map-schema-errors.md
@@ -0,0 +1,15 @@
1
+---
2
+'@objectstack/rest': patch
3
4
+
5
+fix(rest): map schema-mismatch & not-null driver errors to structured 4xx
6
7
+`mapDataError` collapsed any SQL-looking driver error into a generic
8
+`500 DATABASE_ERROR`, so a bad write payload to the data API leaked a 500
9
+instead of a fixable 4xx (e.g. `POST /data/sys_team` with an unknown field,
10
+or omitting a required column). It now maps unknown-column errors to
11
+`400 INVALID_FIELD { field }` and not-null violations to
12
+`400 VALIDATION_FAILED { fields:[{required}] }` across SQLite/Postgres/MySQL
13
+phrasings, placed before the unknown-object branch so Postgres
14
+`column … of relation … does not exist` is not mis-mapped to 404. Genuine
15
+driver faults still return 500; unique violations still return 409.
0 commit comments