Skip to content

Commit

Permalink
handle json error responses
Browse files Browse the repository at this point in the history
  • Loading branch information
ToTeTo committed Apr 15, 2024
1 parent 4adeab5 commit 582b85e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/vidosResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ export class VidosResolver implements Resolvable {
},
});

if (resolutionResponse.ok) return resolutionResponse.json();
if (resolutionResponse.ok) {
return resolutionResponse.json();
} else if (resolutionResponse.headers.get("content-type")?.includes("application/json")) {
return resolutionResponse.json();
}
throw new Error("Failed to resolve DID");
}

Expand Down

0 comments on commit 582b85e

Please sign in to comment.