Exception: Mpp::Extensions::MCP::PaymentRequiredError
- Inherits:
-
StandardError
- Object
- StandardError
- Mpp::Extensions::MCP::PaymentRequiredError
- Extended by:
- T::Sig
- Defined in:
- lib/mpp/extensions/mcp/errors.rb
Instance Attribute Summary collapse
-
#challenges ⇒ Object
readonly
Returns the value of attribute challenges.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(challenges:, message: "Payment Required") ⇒ PaymentRequiredError
constructor
A new instance of PaymentRequiredError.
- #to_jsonrpc_error ⇒ Object
Constructor Details
#initialize(challenges:, message: "Payment Required") ⇒ PaymentRequiredError
Returns a new instance of PaymentRequiredError.
17 18 19 20 21 |
# File 'lib/mpp/extensions/mcp/errors.rb', line 17 def initialize(challenges:, message: "Payment Required") @challenges = T.let(challenges, T.untyped) @code = T.let(CODE_PAYMENT_REQUIRED, Integer) super() end |
Instance Attribute Details
#challenges ⇒ Object (readonly)
Returns the value of attribute challenges.
11 12 13 |
# File 'lib/mpp/extensions/mcp/errors.rb', line 11 def challenges @challenges end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
14 15 16 |
# File 'lib/mpp/extensions/mcp/errors.rb', line 14 def code @code end |
Instance Method Details
#to_jsonrpc_error ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/mpp/extensions/mcp/errors.rb', line 24 def to_jsonrpc_error { "code" => CODE_PAYMENT_REQUIRED, "message" => , "data" => { "httpStatus" => HTTP_STATUS_PAYMENT_REQUIRED, "challenges" => @challenges.map(&:to_dict) } } end |