Skip to content

Commit

Permalink
🧑‍💻 friendly message, close #21
Browse files Browse the repository at this point in the history
  • Loading branch information
vikiival committed Sep 3, 2023
1 parent d3f4f14 commit f78ea8d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/indexers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ function getUrl(chain: Prefix, provider: Or<Provider, ''> = ''): string {
const result: string | undefined = INDEXERS[chain]

if (!result || provider === 'subquery') {
throw new ReferenceError('Indexer not found')
const message = !chain
? `Cannot use fetch for non-existinng chain, add parameter prefix when calling getClient or fetchQuery`
: `Indexer for chain ${chain} not found, allowed values are ${Object.keys(
INDEXERS
)}`
throw new ReferenceError(message)
}

return result
Expand Down

0 comments on commit f78ea8d

Please sign in to comment.