Exception: Anthropic::Credentials::WorkloadIdentityError
- Inherits:
-
Errors::Error
- Object
- StandardError
- Errors::Error
- Anthropic::Credentials::WorkloadIdentityError
- Defined in:
- lib/anthropic/credentials/workload_identity.rb
Overview
Raised when the OIDC token exchange (+POST /v1/oauth/token+) fails.
This error includes additional diagnostic information from the token endpoint response to help debug federation configuration issues.
Instance Attribute Summary collapse
-
#body ⇒ Hash, ...
readonly
Error body from the token endpoint (redacted for safety).
-
#request_id ⇒ String?
readonly
Request ID from the token endpoint response headers.
-
#status_code ⇒ Integer?
readonly
HTTP status code from the token endpoint, if available.
Instance Method Summary collapse
-
#initialize(message, status_code: nil, body: nil, request_id: nil) ⇒ WorkloadIdentityError
constructor
A new instance of WorkloadIdentityError.
-
#to_s ⇒ String
Formatted error message including request ID if available.
Constructor Details
#initialize(message, status_code: nil, body: nil, request_id: nil) ⇒ WorkloadIdentityError
Returns a new instance of WorkloadIdentityError.
23 24 25 26 27 28 |
# File 'lib/anthropic/credentials/workload_identity.rb', line 23 def initialize(, status_code: nil, body: nil, request_id: nil) super() @status_code = status_code @body = body @request_id = request_id end |
Instance Attribute Details
#body ⇒ Hash, ... (readonly)
Returns error body from the token endpoint (redacted for safety).
14 15 16 |
# File 'lib/anthropic/credentials/workload_identity.rb', line 14 def body @body end |
#request_id ⇒ String? (readonly)
Returns request ID from the token endpoint response headers.
17 18 19 |
# File 'lib/anthropic/credentials/workload_identity.rb', line 17 def request_id @request_id end |
#status_code ⇒ Integer? (readonly)
Returns HTTP status code from the token endpoint, if available.
11 12 13 |
# File 'lib/anthropic/credentials/workload_identity.rb', line 11 def status_code @status_code end |
Instance Method Details
#to_s ⇒ String
Returns formatted error message including request ID if available.
31 32 33 34 |
# File 'lib/anthropic/credentials/workload_identity.rb', line 31 def to_s base = super request_id ? "#{base} [request_id=#{request_id}]" : base end |