Improve error handling in AbstractDomainRepository