Added trap on error with the pointer to the log.