Skip to content

Commit

Permalink
Release v6.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
imjoehaines committed Jul 27, 2020
2 parents 1d43234 + a893ea6 commit bd97e4c
Show file tree
Hide file tree
Showing 84 changed files with 1,439 additions and 545 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
Changelog
=========

## 6.15.0 (27 July 2020)

### Enhancements

* Add `on_error` callbacks to replace `before_notify_callbacks`
| [#608](https://github.com/bugsnag/bugsnag-ruby/pull/608)

* Improve performance when extracting code from files in stacktraces
| [#604](https://github.com/bugsnag/bugsnag-ruby/pull/604)

* Reduce memory use when session tracking is disabled
| [#606](https://github.com/bugsnag/bugsnag-ruby/pull/606)

### Deprecated

* `before_notify_callbacks` have been deprecated in favour of `on_error` and will be removed in the next major release

## 6.14.0 (20 July 2020)

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.14.0
6.15.0
28 changes: 4 additions & 24 deletions example/padrino/app/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,6 @@ class App < Padrino::Application
'bugsnag.com for a new notification!')
end

get '/crash_with_callback' do
Bugsnag.before_notify_callbacks << proc { |report|
new_tab = {
message: 'Padrino demo says: Everything is great',
code: 200
}
report.add_tab(:diagnostics, new_tab)
}

msg = 'Bugsnag Padrino demo says: It crashed! But, due to the attached callback' +
' the exception has meta information. Go check' +
' bugsnag.com for a new notification (see the Diagnostics tab)!'
raise RuntimeError.new(msg)
end

get '/notify' do
Bugsnag.notify(RuntimeError.new("Bugsnag Padrino demo says: False alarm, your application didn't crash"))

Expand All @@ -100,21 +85,16 @@ class App < Padrino::Application

get '/notify_data' do
error = RuntimeError.new("Bugsnag Padrino demo says: False alarm, your application didn't crash")
Bugsnag.notify error do |report|
report.add_tab(:user, {
:username => "bob-hoskins",
:email => 'bugsnag@bugsnag.com',
:registered_user => true
})
Bugsnag.notify(error) do |report|
report.add_tab(:diagnostics, {
:message => 'Padrino demo says: Everything is great',
:code => 200
message: 'Padrino demo says: Everything is great',
code: 200
})
end

"Bugsnag Padrino demo says: It didn't crash! " +
'But still go check <a href="https://bugsnag.com">https://bugsnag.com</a>' +
' for a new notification. Check out the User tab for the meta data'
' for a new notification. Check out the Diagnostics tab for the meta data'
end

get '/notify_severity' do
Expand Down
14 changes: 5 additions & 9 deletions example/padrino/app/templates/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@ While testing the examples open [your dashboard](https://app.bugsnag.com) in ord
<br/>
Raises an error within the framework, generating a report in the Bugsnag dashboard.

2. [Crash and use callbacks](/crash_with_callback)
<br/>
Raises an exception within the framework, but with additional data attached to the report. By registering a callback before the error occurs useful data can be attached as a tab in the Bugsnag dashboard.

3. [Notify](/notify)
2. [Notify](/notify)
<br/>
Sends Bugsnag a report on demand using `bugsnag.notify`. Allows details of handled errors or information to be sent to the Bugsnag dashboard without crashing your code.

4. [Notify with data](/notify_data)
3. [Notify with data](/notify_data)
<br/>
Same as `notify` but allows you to attach additional data within a `block`, similar to the `before_notify_callbacks` example above. In this case we're adding information about the user to go into the `user` tab, and additional diagnostics as a `diagnostics` tab.
Same as `notify` but allows you to attach additional data within a `block`. In this case we're adding additional diagnostics as a `diagnostics` tab.

5. [Set the severity](/notify_severity)
4. [Set the severity](/notify_severity)
<br/>
This uses the same mechanism as adding meta-data, but allows you to set he `severity` when notifying Bugsnag of the error. Valid severities are `error`, `warning`, and `info`. Have a look on the dashboard to see the difference in these severities.
This uses the same mechanism as adding meta-data, but allows you to set he `severity` when notifying Bugsnag of the error. Valid severities are `error`, `warning`, and `info`. Have a look on the dashboard to see the difference in these severities.
8 changes: 8 additions & 0 deletions example/padrino/config/boot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@
Padrino.before_load do
Bugsnag.configure do |config|
config.api_key = 'YOUR_API_KEY'

config.add_on_error(proc do |report|
report.add_tab(:user, {
username: 'bob-hoskins',
email: 'bugsnag@bugsnag.com',
registered_user: true
})
end)
end
end

Expand Down
35 changes: 12 additions & 23 deletions example/rack/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@
require 'bugsnag'
require 'redcarpet'


Bugsnag.configure do |config|
config.api_key = 'YOUR_API_KEY'

config.add_on_error(proc do |report|
report.add_tab(:user, {
username: 'bob-hoskins',
email: 'bugsnag@bugsnag.com',
registered_user: true
})
end)
end

class BugsnagDemo
Expand All @@ -18,19 +25,6 @@ def call(env)
when '/crash'
raise RuntimeError.new('Bugsnag Rack demo says: It crashed! Go check ' +
'bugsnag.com for a new notification!')
when '/crash_with_callback'
Bugsnag.before_notify_callbacks << proc { |report|
new_tab = {
message: 'Rack demo says: Everything is great',
code: 200
}
report.add_tab(:diagnostics, new_tab)
}

msg = 'Bugsnag Rack demo says: It crashed! But, due to the attached callback' +
' the exception has meta information. Go check' +
' bugsnag.com for a new notification (see the Diagnostics tab)!'
raise RuntimeError.new(msg)
when '/notify'
Bugsnag.notify(RuntimeError.new("Bugsnag Rack demo says: False alarm, your application didn't crash"))

Expand All @@ -39,21 +33,16 @@ def call(env)
' for a new notification.'
when '/notify_data'
error = RuntimeError.new("Bugsnag Rack demo says: False alarm, your application didn't crash")
Bugsnag.notify error do |report|
report.add_tab(:user, {
:username => "bob-hoskins",
:email => 'bugsnag@bugsnag.com',
:registered_user => true
})
Bugsnag.notify(error) do |report|
report.add_tab(:diagnostics, {
:message => 'Rack demo says: Everything is great',
:code => 200
message: 'Padrino demo says: Everything is great',
code: 200
})
end

text = "Bugsnag Rack demo says: It didn't crash! " +
'But still go check <a href="https://bugsnag.com">https://bugsnag.com</a>' +
' for a new notification. Check out the User tab for the meta data'
' for a new notification. Check out the Diagnostics tab for the meta data'
when '/notify_severity'
msg = "Bugsnag Rack demo says: Look at the circle on the right side. It's different"
error = RuntimeError.new(msg)
Expand Down
14 changes: 5 additions & 9 deletions example/rack/templates/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@ While testing the examples open [your dashboard](https://app.bugsnag.com) in ord
<br/>
Raises an error within the framework, generating a report in the Bugsnag dashboard.

2. [Crash and use callbacks](/crash_with_callback)
<br/>
Raises an exception within the framework, but with additional data attached to the report. By registering a callback before the error occurs useful data can be attached as a tab in the Bugsnag dashboard.

3. [Notify](/notify)
2. [Notify](/notify)
<br/>
Sends Bugsnag a report on demand using `bugsnag.notify`. Allows details of handled errors or information to be sent to the Bugsnag dashboard without crashing your code.

4. [Notify with data](/notify_data)
3. [Notify with data](/notify_data)
<br/>
Same as `notify` but allows you to attach additional data within a `block`, similar to the `before_notify_callbacks` example above. In this case we're adding information about the user to go into the `user` tab, and additional diagnostics as a `diagnostics` tab.
Same as `notify` but allows you to attach additional data within a `block`. In this case we're adding additional diagnostics as a `diagnostics` tab.

5. [Set the severity](/notify_severity)
4. [Set the severity](/notify_severity)
<br/>
This uses the same mechanism as adding meta-data, but allows you to set he `severity` when notifying Bugsnag of the error. Valid severities are `error`, `warning`, and `info`. Have a look on the dashboard to see the difference in these severities.
This uses the same mechanism as adding meta-data, but allows you to set he `severity` when notifying Bugsnag of the error. Valid severities are `error`, `warning`, and `info`. Have a look on the dashboard to see the difference in these severities.
26 changes: 4 additions & 22 deletions example/rails-42/app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,6 @@ def crash
'bugsnag.com for a new notification')
end

def callback
Bugsnag.before_notify_callbacks << proc { |report|
new_tab = {
message: 'Rails v4.2 demo says: Everything is great',
code: 200
}
report.add_tab(:diagnostics, new_tab)
}
raise RuntimeError.new('Bugsnag Rails demo says: It crashed! But, due to the attached callback' +
' the exception has meta information. Go check' +
' bugsnag.com for a new notification (see the Diagnostics tab)!')
end

def notify
Bugsnag.notify(RuntimeError.new("Bugsnag Rails demo says: False alarm, your application didn't crash"))
@text = "Bugsnag Rack demo says: It didn't crash! " +
Expand All @@ -32,20 +19,15 @@ def notify

def data
error = RuntimeError.new("Bugsnag Rails demo says: False alarm, your application didn't crash")
Bugsnag.notify error do |report|
report.add_tab(:user, {
:username => "bob-hoskins",
:email => 'bugsnag@bugsnag.com',
:registered_user => true
})
Bugsnag.notify(error) do |report|
report.add_tab(:diagnostics, {
:message => 'Rails demo says: Everything is great',
:code => 200
message: 'Rails demo says: Everything is great',
code: 200
})
end
@text = "Bugsnag Rails demo says: It didn't crash! " +
'But still go check <a href="https://bugsnag.com">https://bugsnag.com</a>' +
' for a new notification. Check out the User tab for the meta data'
' for a new notification. Check out the Diagnostics tab for the meta data'
end

def severity
Expand Down
14 changes: 5 additions & 9 deletions example/rails-42/app/views/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@ While testing the examples open [your dashboard](https://app.bugsnag.com) in ord
<br/>
Raises an error within the framework, generating a report in the Bugsnag dashboard.

2. [Crash and use callbacks](/crash_with_callback)
<br/>
Raises an exception within the framework, but with additional data attached to the report. By registering a callback before the error occurs useful data can be attached as a tab in the Bugsnag dashboard.

3. [Notify](/notify)
2. [Notify](/notify)
<br/>
Sends Bugsnag a report on demand using `bugsnag.notify`. Allows details of handled errors or information to be sent to the Bugsnag dashboard without crashing your code.

4. [Notify with data](/notify_data)
3. [Notify with data](/notify_data)
<br/>
Same as `notify` but allows you to attach additional data within a `block`, similar to the `before_notify_callbacks` example above. In this case we're adding information about the user to go into the `user` tab, and additional diagnostics as a `diagnostics` tab.
Same as `notify` but allows you to attach additional data within a `block`. In this case we're adding additional diagnostics as a `diagnostics` tab.

5. [Set the severity](/notify_severity)
4. [Set the severity](/notify_severity)
<br/>
This uses the same mechanism as adding meta-data, but allows you to set he `severity` when notifying Bugsnag of the error. Valid severities are `error`, `warning`, and `info`. Have a look on the dashboard to see the difference in these severities.
This uses the same mechanism as adding meta-data, but allows you to set he `severity` when notifying Bugsnag of the error. Valid severities are `error`, `warning`, and `info`. Have a look on the dashboard to see the difference in these severities.
8 changes: 8 additions & 0 deletions example/rails-42/config/initializers/bugsnag.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Bugsnag.configure do |config|
config.api_key = "YOUR_API_KEY_HERE"

config.add_on_error(proc do |report|
report.add_tab(:user, {
username: 'bob-hoskins',
email: 'bugsnag@bugsnag.com',
registered_user: true
})
end)
end
4 changes: 1 addition & 3 deletions example/rails-42/config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
Rails.application.routes.draw do
root :to => 'application#index'

get 'crash' => 'application#crash'
get 'crash_with_callback' => 'application#callback'
get 'notify' => 'application#notify'
get 'notify_data' => 'application#data'
get 'notify_severity' => 'application#severity'

end
4 changes: 2 additions & 2 deletions example/rails-51/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,5 @@ Navigate to the `/resque` page and queue any of the examples using links provide
To process the queues, run the `resque:work` task as stated in the example webpage. In order to process any of the queues on a single thread start the resque worker using the command:

```shell
QUEUE=crash,callback,metadata bundle exec rake resque:work
```
QUEUE=crash,metadata bundle exec rake resque:work
```
26 changes: 4 additions & 22 deletions example/rails-51/app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,6 @@ def crash
'bugsnag.com for a new notification')
end

def callback
Bugsnag.before_notify_callbacks << proc { |report|
new_tab = {
message: 'Rails v4.2 demo says: Everything is great',
code: 200
}
report.add_tab(:diagnostics, new_tab)
}
raise RuntimeError.new('Bugsnag Rails demo says: It crashed! But, due to the attached callback' +
' the exception has meta information. Go check' +
' bugsnag.com for a new notification (see the Diagnostics tab)!')
end

def notify
Bugsnag.notify(RuntimeError.new("Bugsnag Rails demo says: False alarm, your application didn't crash"))
@text = "Bugsnag Rack demo says: It didn't crash! " +
Expand All @@ -32,20 +19,15 @@ def notify

def data
error = RuntimeError.new("Bugsnag Rails demo says: False alarm, your application didn't crash")
Bugsnag.notify error do |report|
report.add_tab(:user, {
:username => "bob-hoskins",
:email => 'bugsnag@bugsnag.com',
:registered_user => true
})
Bugsnag.notify(error) do |report|
report.add_tab(:diagnostics, {
:message => 'Rails demo says: Everything is great',
:code => 200
message: 'Rails demo says: Everything is great',
code: 200
})
end
@text = "Bugsnag Rails demo says: It didn't crash! " +
'But still go check <a href="https://bugsnag.com">https://bugsnag.com</a>' +
' for a new notification. Check out the User tab for the meta data'
' for a new notification. Check out the Diagnostics tab for the meta data'
end

def severity
Expand Down
5 changes: 0 additions & 5 deletions example/rails-51/app/controllers/que_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,4 @@ def crash
QueCrash.enqueue
@text = "Que has queued the crash task"
end

def callbacks
QueCallback.enqueue
@text = "Que has queued the callbacks task"
end
end
5 changes: 0 additions & 5 deletions example/rails-51/app/controllers/resque_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,4 @@ def metadata
Resque.enqueue(ResqueWorkers::Metadata)
@text = "The metadata task has been queued. This can be run using the `QUEUE=metadata bundle exec rake resque:work` command"
end

def callbacks
Resque.enqueue(ResqueWorkers::Callback)
@text = "The callback task has been queued. This can be run using the `QUEUE=callback bundle exec rake resque:work` command"
end
end
5 changes: 0 additions & 5 deletions example/rails-51/app/controllers/sidekiq_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,4 @@ def metadata
@text = "Sidekiq is performing a task that will notify an error with some metadata without crashing.
Check out your dashboard!"
end

def callbacks
SidekiqWorkers::CallbackWorker.perform_async
@text = "Sidekiq is performing a task that will crash, but registers a callback before this to attach additional metadata."
end
end
14 changes: 0 additions & 14 deletions example/rails-51/app/jobs/que_callback.rb

This file was deleted.

Loading

0 comments on commit bd97e4c

Please sign in to comment.