Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ggomagundan/api-error-responser
https://github.com/ggomagundan/api-error-responser
Last synced: 20 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ggomagundan/api-error-responser
- Owner: ggomagundan
- Created: 2015-12-16T04:24:44.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-16T03:04:13.000Z (almost 9 years ago)
- Last Synced: 2024-04-15T02:40:30.803Z (7 months ago)
- Language: Ruby
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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