Getting the HTTP status code of a @sapphire/fetch request

Title says it all basically, I need to know the status code of an api response for error handling
4 Replies
Favna
Favna2y ago
You set the status code when responding, and it's 200 by default. So I'm not sure what you mean with getting it.
Sean
SeanOP2y ago
So HCB's transparency API responds with a 404 if it can't find the org. I need to know when it responds with a 404
Favna
Favna2y ago
oh my bad I read the question wrong
Favna
Favna2y ago
fetch() global function - Web APIs | MDN
The global fetch() method starts the process of fetching a resource from the network, returning a promise which is fulfilled once the response is available.
Want results from more Discord servers?
Add your server