Skip to main content

ResponseError.fromResponse()

Home > @backstage/errors > ResponseError > fromResponse

Constructs a ResponseError based on a failed response.

Assumes that the response has already been checked to be not ok. This function consumes the body of the response, and assumes that it hasn't been consumed before.

Signature:

static fromResponse(response: ConsumedResponse & {
text(): Promise<string>;
}): Promise<ResponseError>;

Parameters

ParameterTypeDescription
responseConsumedResponse & { text(): Promise<string>; }

Returns:

Promise<ResponseError>