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
You set the status code when responding, and it's 200 by default. So I'm not sure what you mean with getting it.
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
oh my bad I read the question wrong
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.