Update handling of unexpected errors.