mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-01 15:14:11 +01:00
30 lines
695 B
PHP
30 lines
695 B
PHP
<?php
|
|
/*
|
|
* @copyright Copyright (C) 2010-2025 Combodo SARL
|
|
* @license http://opensource.org/licenses/AGPL-3.0
|
|
*/
|
|
|
|
namespace Combodo\iTop\Forms;
|
|
|
|
use Exception;
|
|
use IssueLog;
|
|
use Throwable;
|
|
|
|
abstract class FormException extends Exception
|
|
{
|
|
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null)
|
|
{
|
|
if (!is_null($previous)) {
|
|
$sStack = $previous->getTraceAsString();
|
|
$sError = $previous->getMessage();
|
|
} else {
|
|
$sStack = $this->getTraceAsString();
|
|
$sError = '';
|
|
}
|
|
|
|
$aContext['error'] = $sError;
|
|
$aContext['stack'] = $sStack;
|
|
IssueLog::Error($message, null, $aContext);
|
|
parent::__construct($message, $code, $previous);
|
|
}
|
|
} |