Moves error handling from the repository to the caller