Making the catch block specifically catch RepositoryExceptions