Use `(int)$repositoryProblem->getCode()` as Exception code here.