Skip to content

Commit

Permalink
Catch errors when building token options in search
Browse files Browse the repository at this point in the history
  • Loading branch information
steveluscher committed Oct 18, 2023
1 parent 68e07e5 commit f75a066
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

0 comments on commit f75a066

Please sign in to comment.