Exception: MCP::Client::SessionExpiredError

Inherits:
RequestHandlerError show all
Defined in:
lib/mcp/client.rb

Overview

Raised when the server responds 404 to a request containing a session ID, indicating the session has expired. Inherits from ‘RequestHandlerError` for backward compatibility with callers that rescue the generic error. Per spec, clients MUST start a new session with a fresh `initialize` request in response.

Instance Attribute Summary

Attributes inherited from RequestHandlerError

#error_type, #original_error, #request

Instance Method Summary collapse

Constructor Details

#initialize(message, request, original_error: nil) ⇒ SessionExpiredError

Returns a new instance of SessionExpiredError.



41
42
43
# File 'lib/mcp/client.rb', line 41

def initialize(message, request, original_error: nil)
  super(message, request, error_type: :not_found, original_error: original_error)
end