Learn / Errors and failures

Server responses and error hiding

RemoteServer.answer and serveFetch scrub internal causes before responding:

Server conditionClient receivesDiagnostic logged
Source fails (RemoteServerError) or throwsInternal error + incident IDServerDefect with cause
Source calls RemoteServer.tell(msg)Typed Remote error with msgNone
RemoteServer.refuse(mutation, refusal)422 (409 for Taken) with refusalNone
RemoteServer.taken() on insert409 Taken naming Entity + IDNone
RemoteServer.forbid(reason?)403 ForbiddenNone
RemoteServer.unauthenticated(reason?)401 UnauthenticatedNone
Mutation input fails schema decodeInvalid mutation inputNone
Field withheld by authorizeField omitted (ID omitted if whole row)None
Drizzle query or write statement failsInternal error + incident IDStatementFailed + ServerDefect
Layer or principal resolver breaks500 Internal error + incident IDServerDefect
Write commits; answer read failsWrite succeeds; rows re-fetchedAnswerUnread
Write commits; live publish failsWrite succeeds; live skips noticePublishFailed

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.