Skip to content

Commit

Permalink
create error 410
Browse files Browse the repository at this point in the history
  • Loading branch information
alejndr0 committed Jun 7, 2024
1 parent 57761db commit 894794e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/octokit/error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def self.from_response(response)
when 405 then Octokit::MethodNotAllowed
when 406 then Octokit::NotAcceptable
when 409 then Octokit::Conflict
when 410 then Octokit::Deprecated
when 415 then Octokit::UnsupportedMediaType
when 422 then error_for_422(body)
when 451 then Octokit::UnavailableForLegalReasons
Expand Down Expand Up @@ -110,6 +111,10 @@ def self.error_for_404(body)
end
end

def self.error_for_410(body)
Octokit::Gone
end

# Return most appropriate error for 422 HTTP status code
# @private
# rubocop:disable Naming/VariableNumber
Expand Down Expand Up @@ -317,6 +322,9 @@ class NotAcceptable < ClientError; end
# Raised when GitHub returns a 409 HTTP status code
class Conflict < ClientError; end

# Raised when GHES Manage return a 410 HTTP status code
class Deprecated < ClientError; end

# Raised when GitHub returns a 414 HTTP status code
class UnsupportedMediaType < ClientError; end

Expand Down

0 comments on commit 894794e

Please sign in to comment.