N°8772 - exceptions

This commit is contained in:
Eric Espie
2025-11-25 17:08:41 +01:00
parent 7a67267c7d
commit 7a515d04dd
6 changed files with 39 additions and 9 deletions

View File

@@ -11,6 +11,7 @@ use Combodo\iTop\Service\DependencyInjection\DIException;
use Combodo\iTop\Service\DependencyInjection\DIService;
use Combodo\iTop\Forms\IO\Format\ClassIOFormat;
use Combodo\iTop\Forms\IO\FormBlockIOException;
use Exception;
/**
* OQL expression to class converter.
@@ -28,7 +29,11 @@ class OqlToClassConverter extends AbstractConverter
}
$oModelReflection = DIService::GetInstance()->GetService('ModelReflection');
$oQuery = $oModelReflection->GetQuery($oData);
try {
$oQuery = $oModelReflection->GetQuery($oData);
} catch (Exception $e) {
throw new FormBlockIOException($e->getMessage(), $e->getCode(), $e);
}
return new ClassIOFormat($oQuery->GetClass());
}
}