Log an error if we're about to fail
Use PHP's native function since errorHandle may not be up yet