Skip to content

Commit

Permalink
Raise Octokit::Conflict for 409 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Lavender committed Oct 21, 2013
1 parent 925aa60 commit 0a6ff62
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/octokit/error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def self.from_response(response)
when 403 then error_for_403(body)
when 404 then Octokit::NotFound
when 406 then Octokit::NotAcceptable
when 409 then Octokit::Conflict
when 415 then Octokit::UnsupportedMediaType
when 422 then Octokit::UnprocessableEntity
when 400..499 then Octokit::ClientError
Expand Down Expand Up @@ -184,6 +185,9 @@ class NotFound < ClientError; end
# Raised when GitHub returns a 406 HTTP status code
class NotAcceptable < ClientError; end

# Raised when GitHub returns a 409 HTTP status code
class Conflict < ClientError; end

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

Expand Down

0 comments on commit 0a6ff62

Please sign in to comment.