Module: Google::Auth::DetailedError::ClassMethods

Defined in:
lib/googleauth/errors.rb

Overview

Class methods to be added to including classes

Instance Method Summary collapse

Instance Method Details

#with_details(message, credential_type_name:, principal:) ⇒ Error

Creates a new error with detailed information

Parameters:

  • message (String)

    The error message

  • credential_type_name (String)

    The credential type that raised the error

  • principal (String, Symbol)

    The principal for the authentication flow

Returns:

  • (Error)

    The new error with details



59
60
61
62
63
64
# File 'lib/googleauth/errors.rb', line 59

def with_details message, credential_type_name:, principal:
  new(message).tap do |error|
    error.instance_variable_set :@credential_type_name, credential_type_name
    error.instance_variable_set :@principal, principal
  end
end