Exception: Parse::Agent::Unauthorized

Inherits:
AgentError
  • Object
show all
Defined in:
lib/parse/agent/errors.rb

Overview

Authentication failure for MCP transport adapters. Custom auth blocks passed to Parse::Agent::MCPRackApp should raise this (or a subclass) to signal an unauthenticated/unauthorized request; the transport layer catches it and renders a sanitized 401 response.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = "Unauthorized", reason: nil) ⇒ Unauthorized

Returns a new instance of Unauthorized.



99
100
101
102
# File 'lib/parse/agent/errors.rb', line 99

def initialize(message = "Unauthorized", reason: nil)
  @reason = reason
  super(message)
end

Instance Attribute Details

#reasonObject (readonly)

Returns the value of attribute reason.



97
98
99
# File 'lib/parse/agent/errors.rb', line 97

def reason
  @reason
end