Well, if you have come to this page then you should be knowing how important is issue tracker in developer's life. The tracker that I am addressing today is Airbrake.
Airbrake gives you pretty clear description about the error. But, what if you want extra information to be added in the subject of the error.
# application_controller.rb
...
if Rails.env.production?
rescue_from StandardError, with: :handle_exception
end
def handle_exception exception
exception.message << "---- Add your custom message here --------"
notify_airbrake(exception)
end
...
notify_airbrake should be used for sending manual notifications and make sure you are calling it when you are still inside the controller else it works same as Airbrake.notify.
In the UI, the status still remains 200 which is bad. So, the fix is:
# application_controller.rb
...
def handle_exception exception
exception.message << "---- Add your custom message here --------"
notify_airbrake(exception)
render :file => 'public/500.html', :status => 500, :layout => false
end
Keep Coding !!!
Ameena