atmosphere explorer

handle error during did document resolution

handle.invalid 7ea97601 52a9e1ba

verified
+8 -2
+8 -2
src/utils/api.ts
··· 62 62 throw new Error("Not a valid DID identifier"); 63 63 } 64 64 65 - const doc = await didDocumentResolver().resolve(did); 66 - didDocCache[did] = doc; 65 + let doc: DidDocument; 66 + try { 67 + doc = await didDocumentResolver().resolve(did); 68 + didDocCache[did] = doc; 69 + } catch (e) { 70 + console.error(e); 71 + throw new Error("Error during did document resolution"); 72 + } 67 73 68 74 const pds = getPdsEndpoint(doc); 69 75 const labeler = getLabelerEndpoint(doc);