grommunio /
grommunio-web
| 1 | <?php |
||
| 2 | |||
| 3 | /** |
||
| 4 | * Defines an exception class for all php Errors. |
||
| 5 | * ErrorException properties and methods http://php.net/manual/en/class.errorexception.php |
||
| 6 | * Exception properties and methods http://www.php.net/manual/en/class.exception.php |
||
| 7 | */ |
||
| 8 | class ZarafaErrorException extends BaseException |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * errcontext is an array that points to the active symbol table at the point the error occurred. |
||
| 12 | * In other words, errcontext will contain an array of every variable that existed in the scope |
||
| 13 | * the error was triggered in. User error handler must not modify error context. |
||
| 14 | */ |
||
| 15 | protected $errorContext = null; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Constructs the Exception. |
||
| 19 | * |
||
| 20 | * @param string $errorMessage The exception message |
||
| 21 | * @param int $code The Exception code |
||
| 22 | * @param string $filename The filename where the exception is thrown. |
||
| 23 | * @param string $lineno The line number where the exception is thrown. |
||
| 24 | * @param string $displayMessage The exception message to show at client side. |
||
| 25 | * @return void |
||
| 26 | */ |
||
| 27 | public function __construct($errorMessage, $code = 0, $filename , $lineno, $errorContext = null, $displayMessage = null) |
||
| 28 | { |
||
| 29 | $this->errorContext = $errorContext; |
||
| 30 | |||
| 31 | if(!$displayMessage) { |
||
| 32 | $displayMessage = _('Action is not performed correctly.'); |
||
| 33 | } |
||
| 34 | |||
| 35 | parent::__construct($errorMessage, $code, null, $displayMessage); |
||
| 36 | $this->setFile($filename); |
||
| 37 | $this->setLineNo($lineno); |
||
| 38 | } |
||
| 39 | |||
| 40 | |||
| 41 | /** |
||
| 42 | * Function sets the filename where the exception was thrown. |
||
| 43 | * @param string filename name of the file where exception was thrown. |
||
| 44 | */ |
||
| 45 | protected function setFile($filename = '') |
||
| 46 | { |
||
| 47 | $this->file = $filename; |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Function sets the line where the exception was thrown. |
||
| 52 | * @param string lineno no of the line in file where exception was thrown. |
||
| 53 | */ |
||
| 54 | protected function setLineNo($lineno = '') |
||
| 55 | { |
||
| 56 | $this->line = $lineno; |
||
| 57 | } |
||
| 58 | } |
||
| 59 | ?> |
||
|
0 ignored issues
–
show
|
Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.
A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.