Merge remote-tracking branch 'origin/support/3.1' into support/3.2

This commit is contained in:
Pierre Goiffon
2024-03-13 09:27:53 +01:00
3 changed files with 27 additions and 7 deletions

View File

@@ -2099,8 +2099,16 @@ class RestUtils
elseif (is_string($key))
{
// OQL
$oSearch = DBObjectSearch::FromOQL($key);
}
try {
$oSearch = DBObjectSearch::FromOQL($key);
} catch (Exception $e) {
throw new CoreOqlException('Query failed to execute', [
'query' => $key,
'exception_class' => get_class($e),
'exception_message' => $e->getMessage(),
]);
}
}
else
{
throw new Exception("Wrong format for key");