Learn / Errors and failures
Server responses and error hiding
RemoteServer.answer and serveFetch scrub internal causes before responding:
| Server condition | Client receives | Diagnostic logged |
|---|---|---|
Source fails (RemoteServerError) or throws | Internal error + incident ID | ServerDefect with cause |
Source calls RemoteServer.tell(msg) | Typed Remote error with msg | None |
RemoteServer.refuse(mutation, refusal) | 422 (409 for Taken) with refusal | None |
RemoteServer.taken() on insert | 409 Taken naming Entity + ID | None |
RemoteServer.forbid(reason?) | 403 Forbidden | None |
RemoteServer.unauthenticated(reason?) | 401 Unauthenticated | None |
| Mutation input fails schema decode | Invalid mutation input | None |
Field withheld by authorize | Field omitted (ID omitted if whole row) | None |
| Drizzle query or write statement fails | Internal error + incident ID | StatementFailed + ServerDefect |
| Layer or principal resolver breaks | 500 Internal error + incident ID | ServerDefect |
| Write commits; answer read fails | Write succeeds; rows re-fetched | AnswerUnread |
| Write commits; live publish fails | Write succeeds; live skips notice | PublishFailed |
Read the incident ID on the client with RemoteData.incident(error) to correlate user reports with server logs. Pass diagnostics: (diagnostic, request) => Effect to serveFetch to capture every diagnostic for a request, including broken layers. See Diagnostics and Hardening.