Skip to content

The throwing middleware implementation available in the documentation is not working #1954

Closed
@darkbasic

Description

@darkbasic

Description

The documentation explains how to throw errors instead of returning them:

onResponse({ response }) {
  if (response.error) {
    throw new Error(response.error.message);
  }
}

Unfortunately it seems to be wrong because I get Property 'error' does not exist on type 'Response':

image

It's not just a matter of bad typings: the error prop just isn't there.

Reproduction

Copy-paste the throwing middleware snippet from the documentation and look for the typing error.

Expected result

The error should be available somewhere if we want to be able to throw it.

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsRequires an update to docsopenapi-fetchRelevant to the openapi-fetch library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions