readActionResponse
Overview
Classifies a model-action response the way every VUEDA action CRUD handler does: a 400 carries field errors, a 409 carries warnings the operator has not acknowledged, and anything else outside the success set is a fetch failure.
Signature
readActionResponse(response, options)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| response | Response | yes | The response to classify. |
| options | object | yes | The classification options. |
options Properties
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| bulk | boolean | Whether this request targets the bulk path or detailed path. Passed straight through to ConfirmationRequiredError so the renderer knows which warnings shape to expect back. | ||
| emptyStatuses | Set | Success statuses whose body is not read back to the caller. | ||
| messagePrefix | string | The message used when the response is a plain failure. | ||
| successStatuses | Set | Statuses that count as success. Defaults to every response.ok status; pass a set to hold a handler to specific codes (delete accepts only 204, plus 200 during a dry run). |
Returns
Promise
The decoded response data, or undefined for an empty status.
Throws
- On a 400.
- On a 409.
- On any other unsuccessful status.
Source
client/lib/utils/fetchSupport.js:67