Probably simpler to have
Code:
RedirectErrors($sFile,$sMode)



Personally, I'd prefer to log serious script failures to the application event log. I don't see why this shouldn't be activated all the time where supported, but for those who are paranoid:
Code:
$=SetOption("EventLogErrors","OFF")



Of course this is not available with Win9x, but that is becoming less of a problem.