No commit activity in last 3 years
No release in over 3 years
Rescuable Gem for any application
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0
~> 2.0.1
~> 4.2.0
~> 3.12
 Project Readme

Welcome to Rescuable Errors

Rescue correctly your application errors.

Getting Started

From command line:

gem install rescuable_errors

Gemfile:

gem "rescuable_errors"

Usage

You can create errors into gem (if you use a fork) or in your application. For example, create app/errors/routing_error.rb in your application:

module RescuableErrors
  class RoutingError < RescuableErrors::ApplicationError
    def initialize
      @code = 404
      @status = 404
      @class = "RescuableErrors::RoutingError"
      super I18n.t("errors.routing")
    end
  end
end

and fail in controller with

fail RescuableErrors::RoutingError.new.

Now will automaticaly render a JSON response with status 404:

"error": {
  "code": 404,
  "class": "RescuableErrors::RoutingError",
  "message": "Routing not found."
}

Contributing

I ❤️ Open source!

Follow github guides for forking a project

Follow github guides for contributing open source

Code Status

Build Status

License

Gem is released under the MIT license.