improve error handling

This commit is contained in:
Brandon Egger 2023-08-29 10:51:10 -05:00
parent 562ff8d2a6
commit 41a0562228

View File

@ -28,17 +28,14 @@ export const auditoryResourceRouter = createTRPCRouter({
});
if (!resource) {
throw new TRPCError({
code: "NOT_FOUND",
message: "The resource you are looking for was not found.",
});
throw Error('not found');
}
return resource;
} catch (e) {
throw new TRPCError({
code: "NOT_FOUND",
message: "The resource you are looking for was not found.",
message: "The resource you are looking for does not exist.",
cause: e,
});
}