Publish curated projectbrain source from 88fab8df1542019289e947f092c2b387e0825c60
This commit is contained in:
1 parent
48e72d07e0
commit
eca2891b07
45 files changed
+2697
-328
No files matched your search
@@ -54,7 +54,7 @@ const requireOwner = (request: FastifyRequest, reply: FastifyReply) => isOwnerRe
|
||||
|
||||
const operationError = (request: FastifyRequest, reply: FastifyReply, error: unknown) => {
|
||||
const code = error instanceof Error ? error.message : "OPERATING_SYSTEM_OPERATION_FAILED";
|
||||
const status = code === "PROJECT_NOT_FOUND" || code.endsWith("NOT_FOUND") ? 404 : code.includes("STALE") || code.includes("CYCLE") ? 409 : 400;
|
||||
const status = code === "PROJECT_NOT_FOUND" || code.endsWith("NOT_FOUND") ? 404 : code.includes("STALE") || code.includes("CYCLE") || code === "WORK_GRAPH_ACTIVE_LEASE" ? 409 : 400;
|
||||
return reply.status(status).send(errorEnvelope(code, "ProjectBrain could not complete this operating-system action.", getRequestId(request)));
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user