exception_handler
exception_handler copied to clipboard
Use verify_request_format! method to check valid request format
This commit fix a problem to be able to render error responses for format distinct to html (for example json) because e.request.format is returning a Mime::Type object that doesn’t match with the values in self.class.respond_to that is a hash with keys :html, :json, etc
Using the responders’ verify_requested_format! we are getting exactly the same goal delegating the tasks in the own responders gem.
Pull Request Test Coverage Report for Build 1565
- 0 of 0 changed or added relevant lines in 0 files are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage decreased (-2.8%) to 59.016%
| Totals | |
|---|---|
| Change from base Build 1563: | -2.8% |
| Covered Lines: | 72 |
| Relevant Lines: | 122 |
💛 - Coveralls
Pull Request Test Coverage Report for Build 1565
- 0 of 0 changed or added relevant lines in 0 files are covered.
- 1 unchanged line in 1 file lost coverage.
- Overall coverage decreased (-2.8%) to 59.016%
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| lib/exception_handler/config.rb | 1 | 77.78% |
| <!-- | Total: | 1 |
| Totals | |
|---|---|
| Change from base Build 1563: | -2.8% |
| Covered Lines: | 72 |
| Relevant Lines: | 122 |