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
Changes along these lines should surface reported errors:
constfetchUrl=async(url: string)=>{constres=awaitfetch(url);constdata=awaitres.json();if(!res.ok){// If the response contains error information, use itif(data&&data.code!==undefined&&data.message){consterror=newError(data.message)asError&{code?: number;details?: any[];};error.code=data.code;error.details=data.details;throwerror;}else{thrownewError(`Bad Response: ${res.status}`);}}returndata;};
The text was updated successfully, but these errors were encountered:
When using
@chain-registry/client
viastarshipjs
, I observed a genericBad response
error and had trouble tracking down the root cause of an issue.I came to learn the starship registry service returned a helpful error message:
But it was swallowed by the client:
chain-registry/v1/packages/client/src/fetcher.ts
Lines 13 to 20 in b3b3918
chain-registry/v2/packages/client/src/fetcher.ts
Lines 26 to 33 in b3b3918
Changes along these lines should surface reported errors:
The text was updated successfully, but these errors were encountered: