push
travis-ci
17 of 17 new or added lines in 2 files covered. (100.0%)
11828 of 12086 relevant lines covered (97.87%)
2501.05 hits per line
1 |
# encoding: utf-8
|
|
2 |
|
|
3 |
require 'descendants_tracker'
|
11✔ |
4 |
|
|
5 |
module Github |
11✔ |
6 |
module Error |
11✔ |
7 |
class GithubError < StandardError |
11✔ |
8 |
extend DescendantsTracker
|
11✔ |
9 |
|
|
10 |
attr_reader :response_message, :response_headers |
11✔ |
11 |
|
|
12 |
# Initialize a new Github error object.
|
|
13 |
#
|
|
14 |
def initialize(message = $!) |
302✔ |
15 |
if message.respond_to?(:backtrace) |
2,242✔ |
16 |
super(message.message)
|
× |
17 |
@response_message = message
|
× |
18 |
else
|
|
19 |
super(message.to_s)
|
2,242✔ |
20 |
end
|
|
21 |
end
|
|
22 |
|
|
23 |
def backtrace |
11✔ |
24 |
if @response_message && @response_message.respond_to?(:backtrace) |
1,524 all except jruby-19mode, jruby-21mode, jruby, jruby-20mode, and rbx-2 ✔ |
25 |
@response_message.backtrace
|
× |
26 |
else
|
|
27 |
super
|
1,524 all except jruby-19mode, jruby-21mode, jruby, jruby-20mode, and rbx-2 ✔ |
28 |
end
|
|
29 |
end
|
|
30 |
end # GithubError |
|
31 |
end # Error |
|
32 |
end # Github |
|
33 |
|
|
34 |
require 'github_api/error/service_error'
|
11✔ |
35 |
require 'github_api/error/client_error'
|
11✔ |