octokit / octokit.js

The all-batteries-included GitHub SDK for Browsers, Node.js, and Deno.
MIT License
7.01k stars 1.03k forks source link

[FEAT]: Include `@octokit/request-error` in the bundle #2464

Closed DariuszPorowski closed 1 year ago

DariuszPorowski commented 1 year ago

Describe the need

Nice to have @octokit/request-error as part of the bundle with re-exported RequestError instance for easy error handling in the typed projects.

// import re-exported RequestError instance from @octokit/request-error
import { Octokit, RequestError } from 'octokit'

const octokit = new Octokit(...)

try {
  return await octokit.rest...({})
} catch (error) {
  if (error instanceof RequestError) {
    // handle Octokit error
  } else {
    // handle all other errors
  }
}

SDK Version

No response

API Version

No response

Relevant log output

No response

Code of Conduct

gr2m commented 1 year ago

Good idea 👍🏼

DariuszPorowski commented 1 year ago

Will prep PR

DariuszPorowski commented 1 year ago

@gr2m hmm trying to create PR, but something has changed on @octokit/request-error today's release:

wolfy1339 commented 1 year ago

I filed https://github.com/octokit/request-error.js/issues/337, I'll get around to fixing that.

We should really make note somewhere of what repos have the hotfix and how many have transitioned to esbuild to avoid pushing bad releases like in this case

You can copy the types from the latest 3.x version for local dev until the issue is resolved

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 2.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 3.0.0-beta.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 7 months ago

:tada: This issue has been resolved in version 2.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: