decentralised message store

refactor: serve did error label

serenity 0f510893 398777c4

Changed files
+3 -2
src
routes
dot-well-known
did-dot-json
+3 -2
src/routes/dot-well-known/did-dot-json/route.ts
···
import type { Route, RouteHandler } from "@/lib/types/routes";
import { didDoc as importedDidDoc } from "@/lib/utils/did";
import { newErrorResponse } from "@/lib/utils/http/responses";
const routeHandlerFactory = (did: Did) => {
const serveDidPlc: RouteHandler = async () => {
···
if (!success)
return newErrorResponse(500, {
message:
-
"did:plc was not set properly. Either the Shard's did:plc is wrong, or the did:plc was not registered with a public ledger.",
-
details: error,
});
return Response.json(didDocument);
···
import type { Route, RouteHandler } from "@/lib/types/routes";
import { didDoc as importedDidDoc } from "@/lib/utils/did";
import { newErrorResponse } from "@/lib/utils/http/responses";
+
import { z } from "zod";
const routeHandlerFactory = (did: Did) => {
const serveDidPlc: RouteHandler = async () => {
···
if (!success)
return newErrorResponse(500, {
message:
+
"Parsing the DID document from a public ledger failed. Either the Shard's did:plc is wrong, the did:plc was not registered with a public ledger, or there is something wrong with the public ledger.",
+
details: z.treeifyError(error),
});
return Response.json(didDocument);