Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

failsafe_response 200 OK

#1602

I've been invoking internal server errors to test Rails status code handling by sending in some malformed JSON.

For an internal server error, however, failsafe_response returns Status: 200 OK with the following in the response body:


Status: 500 Internal Server Error

Content-Type: text/html

<html><body><h1>500 Internal Server Error</h1></body></html>

As an aside, I think Rail's error handling schizophrenia between production and development needs to be simplified. Just send the right status header and put just the status text in the response body (to help clients who can't get at the Status header). The developer can get his exception report in the server logs.

Reported by ronin-24025 (at lighthouseapp) · December 19th, 2008 @ 07:18 AM

State: wontfix
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. josh
    josh
    • State changed from new to wontfix
    
          def failsafe_response(exception)
            log_failsafe_exception(exception)
            [500, {'Content-Type' => 'text/html'}, failsafe_response_body]
          rescue Exception => failsafe_error # Logger or IO errors
            $stderr.puts "Error during failsafe response: #{failsafe_error}"
          end
    

    Looks like a 500 status code to me. Are you on edge?

    December 20th, 2008 @ 04:36 PM

  2. Bill Kirtley
    Bill Kirtley

    This bug exists in versions of Rails up to 2.2.2, but not in the 2.3 code.

    Will there be a 2.2.3? Is there somewhere to submit a patch?

    http://billkirtley.wordpress.com...

    March 3rd, 2009 @ 08:36 PM