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
The code in the fetch middleware forcefully overwrites any received error with a meaningless "internal JSON-RPC error".
Is there a valid reason to do that? If the JSON-RPC returns a valid error object with a correct code, message (and eventually data), why is that not used?
function parseResponse(fetchRes: Response, body: Record<string, Block>): Block {
// check for error code
if (fetchRes.status !== 200) {
throw rpcErrors.internal({
message: `Non-200 status code: '${fetchRes.status}'`,
data: body,
});
}
// check for rpc error
if (body.error) {
throw rpcErrors.internal({
data: body.error,
});
}
// return successful result
return body.result;
}
The text was updated successfully, but these errors were encountered:
The code in the fetch middleware forcefully overwrites any received error with a meaningless "internal JSON-RPC error".
Is there a valid reason to do that? If the JSON-RPC returns a valid error object with a correct code, message (and eventually data), why is that not used?
The text was updated successfully, but these errors were encountered: