atmosphere explorer pds.ls
tool typescript atproto
434
fork

Configure Feed

Select the types of activity you want to include in your feed.

surface lexicon schema resolution error

Juliet 7c6a3ed7 740b60db

+6 -6
+6 -6
src/lib/schema-tab.tsx
··· 32 32 const location = useLocation(); 33 33 const [schema, setSchema] = createSignal<ResolvedSchema>(); 34 34 const [authority, setAuthority] = createSignal<AtprotoDid>(); 35 - const [error, setError] = createSignal(false); 35 + const [error, setError] = createSignal<string>(); 36 36 const [loading, setLoading] = createSignal(false); 37 37 38 38 const showSchema = () => location.hash === "#schema" || location.hash.startsWith("#schema:"); 39 39 40 40 createEffect(() => { 41 41 const col = collection(); 42 - if (showSchema() && !schema() && !loading() && !error() && col) { 42 + if (showSchema() && !schema() && !loading() && error() === undefined && col) { 43 43 setLoading(true); 44 44 resolve(col as Nsid).then( 45 45 (result) => { ··· 47 47 setSchema(result.schema); 48 48 setLoading(false); 49 49 }, 50 - () => { 51 - setError(true); 50 + (err) => { 51 + setError(err instanceof Error ? err.message : "Unknown error"); 52 52 setLoading(false); 53 53 }, 54 54 ); ··· 62 62 schema?: ResolvedSchema; 63 63 authority?: AtprotoDid; 64 64 loading: boolean; 65 - error: boolean; 65 + error?: string; 66 66 fallbackSchema?: any; 67 67 }) => ( 68 68 <> 69 69 <Show when={props.error && !props.fallbackSchema}> 70 - <span class="mt-2">Lexicon schema could not be resolved.</span> 70 + <span class="mx-2 mt-2">Error during resolution: {props.error}</span> 71 71 </Show> 72 72 <Show when={props.loading && !props.fallbackSchema}> 73 73 <span class="mt-2 text-neutral-700 dark:text-neutral-300">Resolving lexicon schema...</span>