in reply to Turning off carp(fatalsToBrowser) [briefly]?

First of all, you shouldn't leave fatalsToBrowser on in production code for security reasons. The error that you are showing includes detailed information about what went wrong, which is extremely useful to anyone who is trying to break into your system. For instance looking at your error message I immediately see that you are running Windows installed in the C: drive, and you are using IndigoPerl.

Secondly, hiding the error won't make it go away. Mime::Lite isn't loading properly. That means that functions from it that you might want to access won't be there. Your software may appear to work in many ways, but I guarantee you that anything which is supposed to hapen after you load Mime::Lite isn't actually happening. (Are you sending the email that you think you're sending?) If you think that it is, then I guarantee you that you are looking at one section of code and thinking that it did X when X is done in another section of code.

Incidentally the reasoning behind my guarantee is that fatalsToBrowser can only kick in, after you encountered a fatal error. That is, your program died, and the message that you see was its dying gasp.

Third I can tell you how to hide the errors. Just put eval around the statement that is causing error messages. That won't fix them, of course, but it sweeps them under the carpet. (Of course doing so liberally is a bad idea...)

  • Comment on Re: Turning off carp(fatalsToBrowser) [briefly]?

Replies are listed 'Best First'.
Re: Re: Turning off carp(fatalsToBrowser) [briefly]?
by jfrm (Monk) on Jan 23, 2004 at 17:49 UTC
    I'm aware of the production code thing and switch it off in public, never fear. This code is production but only ever used by me so I like to keep it on so I know when things aren't ideal. Really, your guarantee is invalid. I do understand it's best to fix it and will spend some more time doing it but there are no last gasps, I can assure you. Something is obviously annoying Mime::Lite but it sends every mail perfectly and then the script carrys on fine and does lots of other stuff too. In fact, these errors appear at the very start, before anything has happened. Then stuff happens, then the emails are sent, then more stuff happens. So it's a funny type of error because it's not fatal but does appear when fatalstobrowser it is on. Thanks for the eval thing...