Skip to main content

Module error

Module error 

Source
Expand description

The two error types the server API returns.

They are not variants of one error, because they mean opposite things about what the peer learns.

GatedError is a refusal that never reaches the wire. The request was well formed and the server simply cannot serve it the way the handler imagined, so the failure stays on this side and the handler is told directly. Sending a JSON-RPC error there teaches the peer something false about the protocol.

DispatchError is a failure while a method was being dispatched, and most of its variants do reach the peer as a JSON-RPC error — the peer named a tool that does not exist, or sent parameters the server could not read. The peer is owed an answer in those cases, and which answer is what the variants distinguish.

Enums§

DispatchError
Why a tool call did not run.
GatedError
Why a feature-specific call was refused.