-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from MindscapeHQ/tl/timeout-post-call
Timeout network request to send crash reports to API
- Loading branch information
Showing
13 changed files
with
123 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Raygun | ||
VERSION = "2.6.0" | ||
VERSION = "2.7.0" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
require_relative '../spec_helper' | ||
require 'stringio' | ||
|
||
describe Raygun do | ||
let(:failsafe_logger) { FakeLogger.new } | ||
|
||
describe '#track_exception' do | ||
context 'send in background' do | ||
before do | ||
Raygun.setup do |c| | ||
c.send_in_background = true | ||
c.api_url = 'http://example.api' | ||
c.api_key = 'foo' | ||
c.debug = true | ||
c.failsafe_logger = failsafe_logger | ||
end | ||
end | ||
|
||
context 'request times out' do | ||
before do | ||
stub_request(:post, 'http://example.api/entries').to_timeout | ||
end | ||
|
||
it 'logs the failure to the failsafe logger' do | ||
error = StandardError.new | ||
|
||
Raygun.track_exception(error) | ||
|
||
# Occasionally doesn't write to the failsafe logger, add small timeout to add some safety | ||
sleep 0.1 | ||
failsafe_logger.get.must_match /Problem reporting exception to Raygun/ | ||
end | ||
end | ||
end | ||
end | ||
|
||
describe '#reset_configuration' do | ||
it 'clears any customized configuration options' do | ||
Raygun.setup do |c| | ||
c.api_url = 'http://test.api' | ||
end | ||
|
||
Raygun.configuration.api_url.must_equal 'http://test.api' | ||
|
||
Raygun.reset_configuration | ||
|
||
Raygun.configuration.api_url.must_equal Raygun.default_configuration.api_url | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters