Open XDGFX opened 6 months ago
I'm using mande to send a post request to a server. Sometimes the server returns a 403 response, so I expect the .post() method to throw an exception, however it doesn't.
mande
.post()
Client side code:
try { const renew = mande(SERVER_URL + '/api/v1/token/renew'); const res = await renew.post<ApiRes<'/token/renew', 'POST'>>(); token = res.token; id = res.id; expires = res.expires; } catch (error) { console.error('Failed to renew token:', error); logout(); return; }
However the catch block never runs, I get this error in the browser console
[XHR]POST. http://localhost:3478/api/v1/token/renew. [HTTP/1.1 403 Forbidden 34ms]
Using Firefox 125.0.3 on macOS.
I'm using
mande
to send a post request to a server. Sometimes the server returns a 403 response, so I expect the.post()
method to throw an exception, however it doesn't.Client side code:
However the catch block never runs, I get this error in the browser console
Using Firefox 125.0.3 on macOS.