MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / announce

Function announce

graph-ui/src/app/atlas-api.ts:85–97  ·  view source on GitHub ↗

* Announce a failed /api call before it is thrown (provider/error-observer.ts), * so the frontend log holds it even though the panel catches it and shows a * sentence instead. A 4xx is the server saying no to this request (warn); * no answer, a 5xx or an unreadable body is a failure (error).

(error: AtlasApiError, detail?: string)

Source from the content-addressed store, hash-verified

83 * no answer, a 5xx or an unreadable body is a failure (error).
84 */
85function announce(error: AtlasApiError, detail?: string): AtlasApiError {
86 if (hasErrorObservers()) {
87 const refused = error.status >= 400 && error.status < 500;
88 reportError({
89 source: 'api',
90 project: new URL(error.route, 'http://127.0.0.1').searchParams.get('project') ?? '',
91 level: refused ? 'warn' : 'error',
92 message: error.message,
93 detail,
94 });
95 }
96 return error;
97}
98
99const text = (value: unknown): string => (typeof value === 'string' ? value : '');
100

Callers 1

requestMethod · 0.70

Calls 3

hasErrorObserversFunction · 0.90
reportErrorFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected