Warning for `error.code` is deprecated, use `error.status`
See original GitHub issueBug Report
Current Behavior
In @octokit/rest
we’re seeing a deprecation warning for error.code
:
`error.code` is deprecated, use `error.status`
This is from here, in Context#config
:
It’s not a super-simple fix, because change it here causes tests to fail without the tests being updated - and that causes TypeScript errors:
So we’ll have to update the types as well.
@gr2m since we’re using our own types for the OctokitError class - what’s more correct here?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:18 (7 by maintainers)
Top Results From Across the Web
Warning: expression closures are deprecated - MDN Web Docs
The JavaScript warning "expression closures are deprecated" occurs when the non-standard expression closure syntax (shorthand function syntax) ...
Read more >node-express error : express deprecated res.send(status ...
You could try this: res.status(200).send((results[0].id).toString());. Guys are right - it doesn't allow numbers.
Read more >Fix Your Craft CMS Deprecation Errors - CraftQuest
The first method is to use the Deprecation Warnings utlitiy in the Craft control panel. This gives you a historical view of all...
Read more >A new mode `Warning[:deprecated] = :error` for 2.7 - Ruby ...
Warning [:deprecated] = :error , to make the warning into an error which produces a full backtrace (and stops the execution). Warning[:deprecated] =...
Read more >Swift is flagging the use of deprecated functions as errors
The ns_deprecated bits refer mostly to things that were deprecated in the various OS verisons rather than our client code. The "Treat Warnings...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m still getting this on probot v9.2.20.
Looks like it’s traced to the bunyan logging lib at lib/bunyan.js#L1146
error.status
is correct, it’s a number. It used to be the status text, that is a breaking change that comes with v8, so we should update it in probot