Skip to content

Commit

Permalink
fix(fetch.ts): improve error message for undefined GraphQL endpoint i…
Browse files Browse the repository at this point in the history
…n fetchEvents
  • Loading branch information
MartinMinkov committed Feb 23, 2024
1 parent 1a6aa9b commit 2e7395a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Changed

- Improve all-around performance by reverting the Apple silicon workaround (https://github.com/o1-labs/o1js/pull/683) as the root problem is now fixed upstream https://github.com/o1-labs/o1js/pull/1456
- Improved error message when trying to use `fetchActions` with a missing Archive Node endpoint https://github.com/o1-labs/o1js/pull/1459
- Improved error message when trying to use `fetchActions`/`fetchEvents` with a missing Archive Node endpoint https://github.com/o1-labs/o1js/pull/1459

### Deprecated

Expand Down
4 changes: 2 additions & 2 deletions src/lib/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,8 @@ async function fetchEvents(
filterOptions: EventActionFilterOptions = {}
) {
if (!graphqlEndpoint)
throw new Error(
'fetchEvents: Specified GraphQL endpoint is undefined. Please specify a valid endpoint.'
throw Error(
'fetchEvents: Specified GraphQL endpoint is undefined. When using events, you must set the archive node endpoint in Mina.Network(). Please ensure your Mina.Network() configuration includes an archive node endpoint.'
);
const { publicKey, tokenId } = accountInfo;
let [response, error] = await makeGraphqlRequest<EventQueryResponse>(
Expand Down

0 comments on commit 2e7395a

Please sign in to comment.