• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

HTTP status code returned by site-wide error handler is 200 OK?

Participant ,
Jun 23, 2014 Jun 23, 2014

Copy link to clipboard

Copied

I'm using a developer install of ColdFusion 11. I set up the following page at http://localhost:8500/test/index.cfm:

<cfthrow type="application" message="This is an error">

When I visit that page, the HTTP status code returned is 500, as expected.

I then created the following page at http://localhost:8500/error.cfm:

<p>Sorry! That was an error.</p>

If I set the site-wide error handler in the CF Admin to /error.cfm and visit /test/index.cfm, the HTTP status code returned is 200 OK.

This seems weird to me. It looks like I can include the following in the error.cfm file to send an error code instead:

<cfheader statuscode="500" statustext="Server Error">

Does anyone see that as problematic? Is there a reason why the site-wide error handler should return 200 OK?

Views

2.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 27, 2014 Jun 27, 2014

Copy link to clipboard

Copied

LATEST

Error Codes are the responsibility of the developer, to define and broadcast. Ultimately, the ColdFusion server has acted appropriately and fulfilled the request (hence the 202). Only the code would know what error was truly thrown, and how to appropriately handle that message to the user, hence the need for you to change the header in the response, if you want that broadcast to the browser in anything of than a "successful request" type of status.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation