-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'on-error-callbacks-maze-runner-tests' into next
- Loading branch information
Showing
16 changed files
with
167 additions
and
4 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
10 changes: 10 additions & 0 deletions
10
features/fixtures/plain/app/report_modification/initiators/handled_on_error.rb
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,10 @@ | ||
require 'bugsnag' | ||
require './app' | ||
|
||
configure_basics | ||
|
||
def run(callback) | ||
Bugsnag.add_on_error(callback) | ||
|
||
Bugsnag.notify(RuntimeError.new("Oh no")) | ||
end |
11 changes: 11 additions & 0 deletions
11
features/fixtures/plain/app/report_modification/initiators/unhandled_on_error.rb
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,11 @@ | ||
require 'bugsnag' | ||
require './app' | ||
|
||
configure_basics | ||
add_at_exit | ||
|
||
def run(callback) | ||
Bugsnag.add_on_error(callback) | ||
|
||
raise RuntimeError.new "Oh no" | ||
end |
29 changes: 29 additions & 0 deletions
29
features/fixtures/plain/app/stack_frame_modification/initiators/handled_on_error.rb
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,29 @@ | ||
require 'bugsnag' | ||
require './app' | ||
|
||
configure_basics | ||
|
||
def run(callback) | ||
Bugsnag.add_on_error(callback) | ||
step_one | ||
end | ||
|
||
def step_one | ||
step_two | ||
end | ||
|
||
def step_two | ||
step_three | ||
end | ||
|
||
def step_three | ||
crash | ||
end | ||
|
||
def crash | ||
begin | ||
"Test".insrt(-1, "!") | ||
rescue Exception => e | ||
Bugsnag.notify(e) | ||
end | ||
end |
26 changes: 26 additions & 0 deletions
26
features/fixtures/plain/app/stack_frame_modification/initiators/unhandled_on_error.rb
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,26 @@ | ||
require 'bugsnag' | ||
require './app' | ||
|
||
configure_basics | ||
add_at_exit | ||
|
||
def run(callback) | ||
Bugsnag.add_on_error(callback) | ||
step_one | ||
end | ||
|
||
def step_one | ||
step_two | ||
end | ||
|
||
def step_two | ||
step_three | ||
end | ||
|
||
def step_three | ||
crash | ||
end | ||
|
||
def crash | ||
raise RuntimeError.new "Oh no" | ||
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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Feature: On error callbacks | ||
|
||
@rails3 @rails4 @rails5 @rails6 | ||
Scenario: Rails on_error works on handled errors | ||
Given I set environment variable "ADD_ON_ERROR" to "true" | ||
And I start the rails service | ||
When I navigate to the route "/handled/unthrown" on the rails app | ||
And I wait to receive a request | ||
Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier" | ||
And the exception "errorClass" equals "RuntimeError" | ||
And the exception "message" starts with "handled unthrown error" | ||
And the event "unhandled" is false | ||
And the event "app.type" equals "rails" | ||
And the event "metaData.request.url" ends with "/handled/unthrown" | ||
And the event "metaData.on_error.source" equals "on_error handled" | ||
|
||
@rails3 @rails4 @rails5 @rails6 | ||
Scenario: Rails on_error works on unhandled errors | ||
Given I set environment variable "ADD_ON_ERROR" to "true" | ||
And I start the rails service | ||
When I navigate to the route "/unhandled/error" on the rails app | ||
And I wait to receive a request | ||
Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier" | ||
And the exception "errorClass" equals "NameError" | ||
And the exception "message" starts with "undefined local variable or method `generate_unhandled_error' for #<UnhandledController" | ||
And the event "unhandled" is true | ||
And the event "app.type" equals "rails" | ||
And the event "metaData.request.url" ends with "/unhandled/error" | ||
And the event "metaData.on_error.source" equals "on_error unhandled" |