paperclipai/paperclip · error
notFoundMessage
Error message
notFoundMessage
What it means
Error "notFoundMessage" thrown in paperclipai/paperclip.
Source
Thrown at server/src/routes/authz.ts:190
* membership checks on non-safe methods) and returns the resource
*
* Usage:
*
* const goal = await getAccessibleResource(req, res, svc.getById(id), "Goal not found");
* if (!goal) return;
*
* Routes with bespoke not-found behavior (legacy `200 []` contracts,
* audit-logged denials) should still compose `hasCompanyAccess` directly.
*/
export async function getAccessibleResource<T extends { companyId: string }>(
req: Request,
res: Response,
resource: T | null | undefined | Promise<T | null | undefined>,
notFoundMessage: string,
): Promise<T | null> {
const resolved = await resource;
if (!resolved || !hasCompanyAccess(req, resolved.companyId)) {
res.status(404).json({ error: notFoundMessage });
return null;
}
assertCompanyAccess(req, resolved.companyId);
return resolved;
}
export function getActorInfo(req: Request): (
{
actorType: "agent";
actorId: string;
agentId: string | null;
runId: string | null;
agentApiKeyId: string | null;
actorSource: "agent_key" | "agent_jwt";
}
| {
actorType: "user";
actorId: string;View on GitHub (pinned to 120ae5428f)
Solutions
- Verify the id in the request path or body refers to an existing record in this company; re-list the parent collection to get a valid id.
- Check that the record was not deleted or archived, and that the request is scoped to the correct companyId.
When it happens
Trigger: Thrown at server/src/routes/authz.ts:190 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@120ae5428f (2026-08-18).
Data as JSON: /api/errors/8abf457b0fdbeb59.
Report an issue: GitHub.