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:

  • The error message

  • The credential type that raised the error

  • The principal for the authentication flow

Returns:

  • 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