Home > @poq/sdk > PoqResponse > fromFailed
Methods creates response object in case error 4xx occured during request.
Signature:
static fromFailed<T, PT = unknown>(response: AbstractResponse | PoqResponse<PT>, overrides?: {
message?: string;
errorMessage?: string;
}): PoqResponse<T>;
Parameter | Type | Description |
---|---|---|
response | AbstractResponse | PoqResponse<PT> | Original response from http client or wrapper. |
overrides | { message?: string; errorMessage?: string; } | (Optional) |
Returns:
PoqResponse<T>
The response with defined error messages that are taken from response body.
console.log(PoqResponse.fromFailed(httpResponse));