3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
13 * Exception thrown during tests where live code would exit.
15 * This is when the code would exit in live mode.
17 * @param string $message
18 * The human friendly error message.
19 * @param string $error_code
20 * A computer friendly error code. By convention, no space (but underscore allowed).
21 * ex: mandatory_missing, duplicate, invalid_format
23 * Extra params to return. eg an extra array of ids. It is not mandatory, but can help the computer using the api.
24 * Keep in mind the api consumer isn't to be trusted. eg. the database password is NOT a good extra data.
26 class CRM_Core_Exception_PrematureExitException
extends RuntimeException
{
29 * Construct the exception. Note: The message is NOT binary safe.
31 * @link https://php.net/manual/en/exception.construct.php
33 * @param string $message [optional] The Exception message to throw.
34 * @param array $errorData
35 * @param int $error_code
36 * @param throwable $previous [optional] The previous throwable used for the exception chaining.
38 public function __construct($message = "", $errorData = [], $error_code = 0, throwable
$previous = NULL) {
39 parent
::__construct($message, $error_code, $previous);
40 $this->errorData
= $errorData +
['error_code' => $error_code];