catch errors while writing to error log to prevent recursive locks