MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / writeFailure

Function writeFailure

src/ui-server/api/trail-store.ts:351–362  ·  view source on GitHub ↗
(err: unknown)

Source from the content-addressed store, hash-verified

349}
350
351function writeFailure(err: unknown): ApiError {
352 const code = (err as NodeJS.ErrnoException).code;
353 const detail = err instanceof Error ? err.message : String(err);
354 if (code === 'EACCES' || code === 'EPERM' || code === 'EROFS') {
355 return new ApiError(
356 'refused',
357 `Saved trails could not be written: ${detail}`,
358 `The viewer writes only to ${TRAILS_RELATIVE_DIR} inside this project. Check that it is writable.`
359 );
360 }
361 return new ApiError('internal', `Saved trails could not be written: ${detail}`);
362}

Callers 2

writeStoredTrailFunction · 0.85
deleteStoredTrailFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected