GithubHelp home page GithubHelp logo

wvanbergen / http_status_exceptions Goto Github PK

View Code? Open in Web Editor NEW
28.0 28.0 9.0 1.71 MB

A Rails plugin to use exceptions for generating HTTP status responses.

Home Page: http://github.com/wvanbergen/http_status_exceptions/wiki

License: MIT License

Ruby 100.00%

http_status_exceptions's People

Contributors

fluxx avatar jamesbebbington avatar japetheape avatar miyagawa avatar wvanbergen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

http_status_exceptions's Issues

Rails log shows Internal Server Error when handling HTTPStatus exceptions

I am throwing an HTTPStatus::BadRequest exception in my controller when a request is invalid. The server correctly replies with a 400 status code and whatever template I give it, but the log in the server console shows:

Started GET "/bla?arg=invalid" for 127.0.0.1 at 2011-08-11 20:14:21 -0400
  Processing by BlasController#index as HTML
  Parameters: {"arg"=>"invalid"}
Completed 500 Internal Server Error in 1ms
Rendered exceptions/bad_request.html.erb within layouts/application (4.0ms)

So everything is returned correctly, but an incorrect value shows up in the log. It isn't the biggest problem, since as far as the client is concerned, everything is normal. But the log messages aren't very useful, since there's no differentiation between the different kinds of exceptions raised.

Thanks for an awesome yet simple gem!

Add specs to project

  • to test correct inclusion in Rails
  • to test exception classes
  • to test the default handling in http_status_exception
  • to test configuration options

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.