Project

exceptio

0.0
The project is in a healthy, maintained state
Exception logging and management
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

Exceptio

Exception logging and management

What it looks like

The list view shows you all the exceptions we caught.

list

We have a detail view, which shows you the exception that happens and the instances it happened, up to 100. It also shows you a graph of when these instances happened.

detail

Installation and Usage

Add this line to your application's Gemfile:

gem 'exceptio'

Add to ApplicationController

rescue_from StandardError, with: :error_render_method

def error_render_method(exception)
  raise exception if Rails.env.development?

  Exceptio::ExceptionRecordingService.new(exception, request_env: request.env).call

  respond_to do |type|
    type.html do
      begin
        render template: "/exceptio/exception", layout: false, status: 500
      rescue
        render template: "/exceptio/exception", layout: false, status: 500
      end
      false
    end
    type.js { render json: { error: 'internal server error' }, status: 500 } 
    type.all { render nothing: true, status: 500 }
  end
end

Next add to the route.rb:

mount Exceptio::Engine => "/exceptions"

Run the Rails tasks to install and run the migrations:

bin/rails exceptio:install:migrations 
bin/rails db:migrate

License

The gem is available as open source under the terms of the MIT License.