[TASK] Remove class.tslib_pagegen.php from EXT:cms/tslib
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Error / ErrorHandlerInterface.php
1 <?php
2 namespace TYPO3\CMS\Core\Error;
3
4 /**
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16 /**
17 * Error handler interface for TYPO3
18 *
19 * This file is a backport from FLOW3
20 *
21 * @author Ingo Renner <ingo@typo3.org>
22 */
23 interface ErrorHandlerInterface {
24 /**
25 * Registers this class as default error handler
26 *
27 * @param int $errorHandlerErrors The integer representing the E_* error level which should be
28 */
29 public function __construct($errorHandlerErrors);
30
31 /**
32 * Defines which error levels should result in an exception thrown.
33 *
34 * @param int $exceptionalErrors The integer representing the E_* error level to handle as exceptions
35 * @return void
36 */
37 public function setExceptionalErrors($exceptionalErrors);
38
39 /**
40 * Handles an error.
41 * If the error is registered as exceptionalError it will by converted into an exception, to be handled
42 * by the configured exceptionhandler. Additionall the error message is written to the configured logs.
43 * If TYPO3_MODE is 'BE' the error message is also added to the flashMessageQueue, in FE the error message
44 * is displayed in the admin panel (as TsLog message)
45 *
46 * @param int $errorLevel The error level - one of the E_* constants
47 * @param string $errorMessage The error message
48 * @param string $errorFile Name of the file the error occurred in
49 * @param int $errorLine Line number where the error occurred
50 * @return bool
51 * @throws \TYPO3\CMS\Core\Error\Exception with the data passed to this method if the error is registered as exceptionalError
52 */
53 public function handleError($errorLevel, $errorMessage, $errorFile, $errorLine);
54
55 }