Skip to content

Commit

Permalink
fix(errorcode): fixed error code >=400 instead of !=200
Browse files Browse the repository at this point in the history
  • Loading branch information
1swaraj committed Jun 18, 2022
1 parent a15b6c6 commit 0f16595
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/provider/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class Provider implements ProviderInterface {
headers,
})
.then((res) => {
if (res.status !== 200) {
if (res.status >= 400) {
throw Error(res.statusText);
}
return res.text();
Expand All @@ -177,7 +177,7 @@ export class Provider implements ProviderInterface {
return parse(res) as Endpoints[T]['RESPONSE'];
})
.catch((err) => {
throw Error(`Could not ${method} from endpoint: ${url} ${err.message}`);
throw Error(`Could not ${method} from endpoint \`${url}\`: ${err.message}`);
});
}

Expand Down
Binary file removed starknet-3.12.3.tgz
Binary file not shown.

0 comments on commit 0f16595

Please sign in to comment.