Skip to content

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

NameTypeRequiredDescription
responseResponseyesThe response to classify.
optionsobjectyesThe classification options.

options Properties

NameTypeRequiredDefaultDescription
bulkbooleanWhether this request targets the bulk path or detailed path. Passed straight through to ConfirmationRequiredError so the renderer knows which warnings shape to expect back.
emptyStatusesSetSuccess statuses whose body is not read back to the caller.
messagePrefixstringThe message used when the response is a plain failure.
successStatusesSetStatuses 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

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2