Refactor handling of the dity repo error.