Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

err.statusCode is undefined #25

Open
JanvanCasteren opened this issue Feb 22, 2023 · 1 comment
Open

err.statusCode is undefined #25

JanvanCasteren opened this issue Feb 22, 2023 · 1 comment

Comments

@JanvanCasteren
Copy link

I just started using your library and noticed that in check-link.js you access err.statusCode.
But this property is undefined when I use the library. However in can find the statuscode at err.response.statusCode

  return fetchHEAD()
    .catch((/** @type {HTTPError} */ err) => {
      console.warn('HEAD error', err)
      // TODO: if HEAD results in a `got.HTTPError`, are there status codes where
      // we can bypass the GET request?
      return fetchGET()
    })
    .catch((/** @type {Response} */ err) => {
      console.warn('GET error', err)
      return /** @type {const} */ ({
        status: 'dead',
        statusCode: err.statusCode
      })
    })
@JanvanCasteren
Copy link
Author

seems to be this issue:

sindresorhus/got#2219

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant