mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-21 00:21:30 +00:00
docs(mcp): document hasError contract for new error envelope shapes
The detector currently matches result.isError === true because the server's catch path produces that envelope. A future handler that returns a structured error without throwing must still be classified by hasError, or the bytes histogram will sample it as success.
This commit is contained in:
parent
f13bd3c4c6
commit
4c24bac0e9
1 changed files with 6 additions and 1 deletions
|
|
@ -138,7 +138,12 @@ export async function shutdownMetrics(): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
/** hasError must be a boolean; never accept the error string — cypher errors echo user input. */
|
||||
/**
|
||||
* hasError must be a boolean; never accept the error string — cypher errors echo user input.
|
||||
* Contract: hasError returns true for any result the caller considers a failed outcome.
|
||||
* If a future handler returns a structured error envelope without throwing, hasError must
|
||||
* still classify it, otherwise the bytes histogram will sample it as success data.
|
||||
*/
|
||||
export async function observe<T>(
|
||||
tool: string,
|
||||
fn: () => Promise<T>,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue