Terrific
Exception handling for your Rails API.
Installation
Add this line to your application's Gemfile:
gem 'terrific'
And then execute:
$ bundle
Or install it yourself as:
$ gem install terrific
Usage
Simply use map_error
in your controller:
class ApplicationController < ActionController::Base
map_error MyAppError::Base, to: :unprocessable_entity
map_error "MyAppError::Other", to: :not_found
end
Contributing
- Fork it ( http://github.com/jasonkriss/terrific/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request