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
Favna13mo 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
Sean13mo 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
Favna13mo ago
oh my bad I read the question wrong
Favna
Favna13mo 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.