Be more general about not crashing on errors and logging