You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am calling some remote API to essentially get details related to some entity. However, that remote API may just not have any details registered and then returns a 404 as per HTTP standards.
What I actually want is to have this case handled gracefully (without throwing any error internally), so that I can - at best just use something like this:
constclient=got.extend(...);constdata=client.get(`accounts/${user_id}/profile`).json()if(data!==undefined){// ...do something with the details...}
Is that possible (without running into the handlers issue #2196 )?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I am calling some remote API to essentially get details related to some entity. However, that remote API may just not have any details registered and then returns a 404 as per HTTP standards.
What I actually want is to have this case handled gracefully (without throwing any error internally), so that I can - at best just use something like this:
Is that possible (without running into the handlers issue #2196 )?
Beta Was this translation helpful? Give feedback.
All reactions