forked from piotrmurach/github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.rb
More file actions
35 lines (25 loc) · 855 Bytes
/
Copy patherror.rb
File metadata and controls
35 lines (25 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# encoding: utf-8
module Github
class Error < StandardError
attr_reader :response_message, :response_headers
def initialize(message, headers)
@response_message = message
super message
end
def inspect
%(#<#{self.class}>)
end
end # Error
# Raised when Github returns the HTTP status code 400
class BadRequest < Error; end
# Raised when Github returns the HTTP status code 401
class Unauthorised < Error; end
# Raised when Github returns the HTTP status code 403
class Forbidden < Error; end
# Raised when Github returns the HTTP status code 404
class ResourceNotFound < Error; end
# Raised when Github returns the HTTP status code 500
class InternalServerError < Error; end
# Raised when Github returns the HTTP status code 503
class ServiceUnavailable < Error; end
end # Github