MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / handleGenerateError

Function handleGenerateError

packages/baseai/src/dev/routes/v1/pipes/run.ts:95–113  ·  view source on GitHub ↗
(c: any, error: unknown)

Source from the content-addressed store, hash-verified

93};
94
95const handleGenerateError = (c: any, error: unknown) => {
96 if (error instanceof ApiErrorZod) {
97 throw error;
98 }
99
100 const errorMessage =
101 error instanceof Error
102 ? error.message
103 : 'Unexpected error occurred in /pipe/v1/run';
104
105 dlog('Error /pipe/v1/run.ts:', error);
106
107 throw new ApiError({
108 status: error instanceof ApiError ? error.status : 500,
109 code: error instanceof ApiError ? error.code : 'INTERNAL_SERVER_ERROR',
110 message: errorMessage,
111 docs: error instanceof ApiError ? error.docs : undefined
112 });
113};
114
115// Main endpoint handler
116const handleRun = async (c: any) => {

Callers 1

handleRunFunction · 0.70

Calls 1

dlogFunction · 0.90

Tested by

no test coverage detected