Exception: VectorMCP::SamplingError

Inherits:
ProtocolError show all
Defined in:
lib/vector_mcp/errors.rb

Overview

Base class for sampling-related errors originating from client or transport during a server-initiated sample request.

Direct Known Subclasses

SamplingRejectedError, SamplingTimeoutError

Instance Attribute Summary

Attributes inherited from ProtocolError

#code, #details, #message, #request_id

Instance Method Summary collapse

Constructor Details

#initialize(message = "An error occurred during sampling.", code: -32_050,, details: nil, request_id: nil) ⇒ SamplingError

Returns a new instance of SamplingError.

Parameters:

  • message (String) (defaults to: "An error occurred during sampling.")

    The error message.

  • code (Integer) (defaults to: -32_050,)

    JSON-RPC error code (typically from client response, or server defined for timeouts etc).

  • details (Object, nil) (defaults to: nil)

    Optional additional error data from client or transport.

  • request_id (String, Integer, nil) (defaults to: nil)

    The ID of the sampling/createMessage request.



148
149
150
151
152
# File 'lib/vector_mcp/errors.rb', line 148

def initialize(message = "An error occurred during sampling.", code: -32_050, details: nil, request_id: nil)
  # Using -32050 as a generic base for sampling errors from server's perspective.
  # Specific errors from client might have different codes.
  super
end