Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ggomagundan/api-error-responser


https://github.com/ggomagundan/api-error-responser

Last synced: 20 days ago
JSON representation

Awesome Lists containing this project

README

        

# Welcome to Ruby Api Error Responser
handle your exceptions elegantly with this module.

## Usage
1. load the file where you want to use.
2. call the methods!
3. examples
```ruby
class Api::PostsController < ApplicationController
def index
return invalid_json if json_checker_says_no
# and this will response
# {"code":"400-00","error":"InvalidJson","description":"The request body is not a valid JSON document."}
end
end
```
Enjoy!

License: MIT