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

[BUG]: [@octokit/request-error] error.code is deprecated, use error.status. #2662

Closed
1 task done
shakibhasan09 opened this issue Apr 24, 2024 · 2 comments
Closed
1 task done
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented

Comments

@shakibhasan09
Copy link

What happened?

Hi, whenever I get an error from github rest api. Octokit throw an error saying error.code is deprecated, use error.status.

Versions

"octokit": "^3.2.0",
"hono": "^4.2.3",
"bun":"^1.0.3"

Relevant log output

get() {
69 |         logOnceCode(
70 |           new import_deprecation.Deprecation(
71 |             "[@octokit/request-error] `error.code` is deprecated, use `error.status`."
72 |           )
73 |         );
                   ^
Deprecation: [@octokit/request-error] `error.code` is deprecated, use `error.status`.
      at get (/home/sakib/Projects/___/api/node_modules/@octokit/request-error/dist-node/index.js:73:15)
      at errorHandler (/home/sakib/Projects/____/api/node_modules/hono/dist/hono-base.js:21:45)
      at /home/sakib/Projects/____/api/node_modules/hono/dist/compose.js:45:14
      at asyncFunctionResume (native:1:1)
      at promiseReactionJobWithoutPromiseUnwrapAsyncContext (native:1:1)
      at promiseReactionJob (native:1:1)

41 |   constructor(message, statusCode, options) {
42 |     super(message);
43 |     if (Error.captureStackTrace) {
44 |       Error.captureStackTrace(this, this.constructor);
45 |     }
46 |     this.name = "HttpError";
        ^
HttpError: Bad credentials - https://docs.github.com/rest
 code: "401"

      at new RequestError (/home/sakib/Projects/____/api/node_modules/@octokit/request-error/dist-node/index.js:46:4)
      at /home/sakib/Projects/______/api/node_modules/@octokit/request/dist-node/index.js:187:47
      at asyncFunctionResume (native:1:1)
      at promiseReactionJobWithoutPromiseUnwrapAsyncContext (native:1:1)
      at promiseReactionJob (native:1:1)

Code of Conduct

  • I agree to follow this project's Code of Conduct
@shakibhasan09 shakibhasan09 added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Apr 24, 2024
Copy link

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@wolfy1339
Copy link
Member

This is a known issue.
It will get fixed in the next major version.

There isn't anything to do in the meantime

@wolfy1339 wolfy1339 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented
Projects
Archived in project
Development

No branches or pull requests

2 participants