mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-20 15:52:24 +02:00
- enhancement: trap exceptions to keep a nice display in case of error
SVN:code[84]
This commit is contained in:
@@ -19,6 +19,8 @@ $oP = new iTopWebPage("iTop - Expression Evaluation", $currentOrganization);
|
||||
$sExpression = utils::ReadParam('expression', '');
|
||||
$sEncoding = utils::ReadParam('encoding', 'oql');
|
||||
|
||||
try
|
||||
{
|
||||
if ($sEncoding == 'crypted')
|
||||
{
|
||||
// Translate $sExpression into a oql expression
|
||||
@@ -52,6 +54,17 @@ if (!empty($sExpression))
|
||||
cmdbAbstractObject::DisplaySet($oP, $oSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(CoreException $e)
|
||||
{
|
||||
$oP->p('<b>An error occured while running the query:</b>');
|
||||
$oP->p($e->getHtmlDesc());
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
$oP->p('<b>An error occured while running the query:</b>');
|
||||
$oP->p($e->getMessage());
|
||||
}
|
||||
|
||||
$oP->output();
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user