Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

next
ts 19 lines 582 Bytes
Raw
1 import { NotFoundError } from '@composio/client/effect';
2
3 /**
4 * A 404 as the Effect client reports one, with the API error envelope when the
5 * scenario has one.
6 */
7 export const notFoundError = (
8 message: string,
9 envelope?: { readonly message: string; readonly suggested_fix: string }
10 ) =>
11 new NotFoundError({
12 message,
13 method: 'GET',
14 url: 'https://mock.invalid',
15 status: 404,
16 requestId: undefined,
17 details: envelope ? { ...envelope, code: 404, slug: 'Not_Found', status: 404 } : undefined,
18 body: envelope ? { error: envelope } : undefined,
19 });