Skip to content

Commit

Permalink
fix: Use NoMethodError instead of NotImplementedError for unimplement…
Browse files Browse the repository at this point in the history
…ed base class methods (#487)
  • Loading branch information
blowmage authored Aug 13, 2024
1 parent 608be30 commit a09df25
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/googleauth/base_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@ def notify_refresh_listeners
end

def expires_within?
raise NotImplementedError
raise NoMethodError, "expires_within? not implemented"
end

private

def token_type
raise NotImplementedError
raise NoMethodError, "token_type not implemented"
end

def fetch_access_token!
raise NotImplementedError
raise NoMethodError, "fetch_access_token! not implemented"
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/googleauth/external_account/base_credentials.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def fetch_access_token! _options = {}
# The retrieved subject token.
#
def retrieve_subject_token!
raise NotImplementedError
raise NoMethodError, "retrieve_subject_token! not implemented"
end

# Returns whether the credentials represent a workforce pool (True) or
Expand Down
6 changes: 3 additions & 3 deletions lib/googleauth/token_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class << self
# @return [String]
# The loaded token data.
def load _id
raise "Not implemented"
raise NoMethodError, "load not implemented"
end

# Put the token data into storage for the given ID.
Expand All @@ -39,15 +39,15 @@ def load _id
# @param [String] token
# The token data to store.
def store _id, _token
raise "Not implemented"
raise NoMethodError, "store not implemented"
end

# Remove the token data from storage for the given ID.
#
# @param [String] id
# ID of the token data to delete
def delete _id
raise "Not implemented"
raise NoMethodError, "delete not implemented"
end
end
end
Expand Down

0 comments on commit a09df25

Please sign in to comment.