Class: Lich::Util::Update::FetchError

Inherits:
Struct
  • Object
show all
Defined in:
documented/common/update/github_client.rb

Overview

Classified reason the most recent GitHubClient request failed.

kind is one of:

:unavailable  - 5xx, 401, 408, or another unexpected status
:rate_limited - 429, or a 403 carrying rate-limit signals; reset_at is set when GitHub reports it
:not_found    - 404 (usually a misconfigured custom repo or branch)
:rejected     - any other 4xx, e.g. 403 access denied or 409 empty repository
:network      - connection, DNS, TLS, or timeout failure
:bad_response - body could not be parsed or lacked the expected data

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#kind ⇒ Object

Returns the value of attribute kind

Returns:

  • (Object) —

    the current value of kind



30
31
32
# File 'documented/common/update/github_client.rb', line 30

def kind
  @kind
end

#reset_at ⇒ Object

Returns the value of attribute reset_at

Returns:

  • (Object) —

    the current value of reset_at



30
31
32
# File 'documented/common/update/github_client.rb', line 30

def reset_at
  @reset_at
end

#status ⇒ Object

Returns the value of attribute status

Returns:

  • (Object) —

    the current value of status



30
31
32
# File 'documented/common/update/github_client.rb', line 30

def status
  @status
end

Instance Method Details

#global? ⇒ Boolean

GitHub-wide failures affect every repository, so a multi-repo sync should stop instead of reporting the same outage once per repo. 404 and other refusals are about one repository, so the sync carries on.

Returns:

  • (Boolean)


36
37
38
# File 'documented/common/update/github_client.rb', line 36

def global?
  !%i[not_found rejected].include?(kind)
end