26031

How to trap program crashes with HTTP error code 500

Question:

I have a number of badly written perl programs serving up my websites. Occasionally they crash and the user sees ...

<em>Software error: Yadda yadda yadda. For help, please send mail to the webmaster (webmaster@mywebsite.com), giving this error message and the time and date of the error.</em>

I don't have access to that email address and even if I did those naughty users cannot be trusted to report this error.

So what I would like to do is get this error to trigger a HTTP error 500, so that I can monitor it with a line in the htaccess file like ...

ErrorDocument 500 /fixThisBug.shtml

Answer1:

Thanks to ThisSuitIsBlackNot for the direction.

The perl programs all have

use CGI::Carp(fatalsToBrowser);

Which stifles the HTTP 500 error. Simply removing this will allow the programs to crash "properly".

Recommend

  • accessing a website through a proxy using Net::HTTP proxy in ruby
  • I'm trying to build up options from an array data value using jsView
  • Put Object in Restangular
  • HTTP_REFERER not working on javascript src
  • Reactjs local image not loading
  • Add Role attribute to MVC3 methods only in Release mode?
  • .htaccess Rewrite url with images from a folder to a php file
  • url rewrite htaccess and php
  • View Raw HTML of CFHTTP call
  • Application of DirectoryIndex to an Alias in Apache
  • htaccess mod_rewrite - Trailing Slash and loop of redirects
  • Wordpress “Post name” permalinks not working
  • Running Python Code on Xampp on windows platform
  • Can't send mails to only Hotmail. (gmail, etc. works perfectly)
  • How to hide spring mvc web app name in the browser url?
  • Parser Error Message: The file '/Site.master' does not exist
  • Integer Linear Programming Java: Multiple Open Source and Commercial tools are available. Which one
  • Two totally different sites (on same server) getting mixed up in Google Search results
  • getting image type of remote image in php
  • How to best manage SMTP clients
  • auth.provider is not set to 'password' when user signs-in with email and password
  • Getting unread count in Sent Folder using Google Apps Script - GMail
  • Email verification using google app script and google forms
  • Illegal mix of collations for operation for date/time comparison
  • C# - Is there a limit to the size of an httpWebRequest stream?
  • Updating server-side rendering client-side
  • Release, debug version and Authorization Google?
  • How to pass list parameters for each object using Spring MVC?
  • using conditional logic : check if record exists; if it does, update it, if not, create it
  • Windows forms listbox.selecteditem displaying “System.Data.DataRowView” instead of actual value
  • Unit Testing MVC Web Application in Visual Studio and Problem with QTAgent
  • Benchmarking RAM performance - UWP and C#
  • Hits per day in Google Big Query
  • FormattedException instead of throw new Exception(string.Format(…)) in .NET
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • Linking SubReports Without LinkChild/LinkMaster
  • How can I remove ASP.NET Designer.cs files?
  • Are Kotlin's Float, Int etc optimised to built-in types in the JVM? [duplicate]
  • sending mail using smtp is too slow
  • XCode 8, some methods disappeared ? ex: layoutAttributesClass() -> AnyClass