Skip to content

Commit

Permalink
Catch errors when building token options in search (#307)
Browse files Browse the repository at this point in the history
Closes #300.
  • Loading branch information
steveluscher committed Oct 18, 2023
1 parent 68e07e5 commit e7ee73d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/components/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ export function SearchBar() {

async function performSearch(search: string): Promise<SearchOptions[]> {
const localOptions = buildOptions(search, cluster, clusterInfo?.epochInfo.epoch);
const tokenOptions = await buildTokenOptions(search, cluster);
let tokenOptions;
try {
tokenOptions = await buildTokenOptions(search, cluster);
} catch (e) {
console.error(`Failed to build token options for search: ${e instanceof Error ? e.message : e}`);
}
const tokenOptionsAppendable = tokenOptions ? [tokenOptions] : [];
const domainOptions =
hasDomainSyntax(search) && cluster === Cluster.MainnetBeta ? (await buildDomainOptions(search)) ?? [] : [];
Expand Down

1 comment on commit e7ee73d

@vercel
Copy link

@vercel vercel bot commented on e7ee73d Oct 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

explorer – ./

explorer-git-master-solana-labs.vercel.app
explorer-solana-labs.vercel.app
explorer.solana.com

Please sign in to comment.