Exception: Github::Error::GithubError

Inherits:
StandardError
  • Object
show all
Extended by:
DescendantsTracker
Defined in:
lib/github_api/error.rb

Direct Known Subclasses

ClientError, ServiceError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = $!) ⇒ GithubError

Initialize a new Github error object.


14
15
16
17
18
19
20
21
# File 'lib/github_api/error.rb', line 14

def initialize(message = $!)
  if message.respond_to?(:backtrace)
    super(message.message)
    @response_message = message
  else
    super(message.to_s)
  end
end

Instance Attribute Details

#response_headersObject (readonly)

Returns the value of attribute response_headers


10
11
12
# File 'lib/github_api/error.rb', line 10

def response_headers
  @response_headers
end

#response_messageObject (readonly)

Returns the value of attribute response_message


10
11
12
# File 'lib/github_api/error.rb', line 10

def response_message
  @response_message
end

Instance Method Details

#backtraceObject


23
24
25
26
27
28
29
# File 'lib/github_api/error.rb', line 23

def backtrace
  if @response_message && @response_message.respond_to?(:backtrace)
    @response_message.backtrace
  else
    super
  end
end