Esempio n. 1
0
 /**
  * @param \Exception $e
  * @param \Carrooi\Doctrine\Entities\BaseEntity $entity
  * @param string $column
  * @param mixed $value
  */
 public function __construct(Exception $e, BaseEntity $entity, $column, $value)
 {
     $this->entity = $entity;
     $this->column = $column;
     $this->value = $value;
     parent::__construct($e->getMessage(), $e->getCode(), $e);
 }
 public function __construct($method, array $allowedMethods, \Exception $previous = null)
 {
     $message = sprintf('Method "%s" is not allowed and must be one of "%s".', $method, implode(', ', $allowedMethods));
     parent::__construct($message, 0, $previous);
     $this->method = $method;
     $this->allowedMethods = $allowedMethods;
 }
 /**
  * Public constructor.
  */
 public function __construct()
 {
     $message = 'You must authenticate to access this resource.';
     $code = 401;
     $this->statusCode = $code;
     parent::__construct($message, $code);
 }
Esempio n. 4
0
 /**
  *
  * @param string $message
  * @param integer $statusCode
  * @param \Exception $previous
  * @param array $errors
  * @param array $headers
  */
 public function __construct($message, $statusCode = 0, \Exception $previous = null, array $errors = [], array $headers = [])
 {
     $this->statusCode = $statusCode;
     $this->headers = $headers;
     $this->errors = $errors;
     parent::__construct($message, $statusCode, $previous);
 }
Esempio n. 5
0
 public function __construct($message = "", $code = 403, Exception $previous = null)
 {
     if (empty($message)) {
         $message = \JText::_('LIB_FOF_VIEW_POSSIBLYSUHOSIN');
     }
     parent::__construct($message, $code, $previous);
 }
 public function WrongTypeException($msg = null)
 {
     if (is_null($msg)) {
         $msg = "Tipo inválido";
     }
     parent::__construct($msg);
 }
Esempio n. 7
0
 /**
  * Create an exception based on LibXMLError objects
  *
  * @param array $errors Array of LibXMLError objects
  * @see http://www.php.net/manual/en/class.libxmlerror.php
  */
 public function __construct(array $errors)
 {
     $numErrors = count($errors);
     if (1 == $numErrors) {
         $message = "An error occurred ";
     } elseif ($numErrors > 1) {
         $message = "Some errors occurred ";
     }
     $message .= "while parsing XML configuration file:\n";
     foreach ($errors as $error) {
         $message .= " - ";
         switch ($error->level) {
             case LIBXML_ERR_WARNING:
                 $message .= "Warning {$error->code}: ";
                 break;
             case LIBXML_ERR_ERROR:
                 $message .= "Error {$error->code}: ";
                 break;
             case LIBXML_ERR_FATAL:
                 $message .= "Fatal Error {$error->code}: ";
                 break;
         }
         $message .= $error->message;
     }
     parent::__construct($message);
 }
 /**
  * @param string $message
  * @param string $actorId
  * @param \DateTimeInterface $sinceDate
  * @param \DateTimeInterface $actualDate
  */
 public function __construct($message, $actorId, \DateTimeInterface $sinceDate, \DateTimeInterface $actualDate)
 {
     parent::__construct($message);
     $this->actorId = $actorId;
     $this->sinceDate = $sinceDate;
     $this->actualDate = $actualDate;
 }
Esempio n. 9
0
 /**
  * Creates an instance.
  *
  * @param string     $optionKey
  * @param int        $target
  * @param \Exception $previous
  */
 public function __construct($optionKey, $target, \Exception $previous = null)
 {
     $this->optionKey = $optionKey;
     $this->target = $target;
     $message = sprintf('Missing value for option "%s" in "%s"', $optionKey, $this->getTargetFQCN());
     parent::__construct($message, 0, $previous);
 }
Esempio n. 10
0
 public function __construct($message = NULL, $code = 0, \Exception $previous = NULL)
 {
     if (!isset($message)) {
         $message = "rowCount() is supported for DELETE, INSERT, or UPDATE statements performed with structured query builders only, since they would not be portable across database engines otherwise. If the query builders are not sufficient, set the 'return' option to Database::RETURN_AFFECTED to get the number of affected rows.";
     }
     parent::__construct($message, $code, $previous);
 }
Esempio n. 11
0
 public function __construct($errorCode, $message, $requestId, $hostId)
 {
     parent::__construct($message);
     $this->requestId = $requestId;
     $this->hostId = $hostId;
     $this->errorCode = $errorCode;
 }
Esempio n. 12
0
 public function App42Exception3($detailMessage, $httpErrorCode, $appErrorCode)
 {
     $this->detailMessage = $detailMessage;
     $this->httpErrorCode = $httpErrorCode;
     $this->appErrorCode = $appErrorCode;
     return parent::__construct($detailMessage, $httpErrorCode);
 }
 public function __construct($name, $value = null, $message = null, $code = 0, \Exception $prevException = null)
 {
     $this->argumentName = $name;
     $this->argumentValue = $value;
     $message = $message ?: sprintf('The argument for "%s" is invalid.', $name);
     parent::__construct($message, $code, $prevException);
 }
 public function __construct($invalidHelper, array $supportedHelpers, \Exception $previous = null)
 {
     $message = sprintf('Unsupported helper "%s". It must be one of %s.', $invalidHelper, implode(', ', $supportedHelpers));
     parent::__construct($message, 0, $previous);
     $this->invalidHelper = $invalidHelper;
     $this->supportedHelpers = $supportedHelpers;
 }
 public function WrongTypeException($msg = null)
 {
     if ($msg == null) {
         $msg = "Esta planilha contem um formato inválido de acordo com os padrões definidos.";
     }
     parent::__construct($msg);
 }
 public function __construct($message = null, $code = null, \Exception $previous = null)
 {
     if (is_null($message)) {
         $message = 'The model for Dobee is invalid!';
     }
     parent::__construct($message, $code, $previous);
 }
 /**
  * @param AggregateRootIdentifier $identifier
  * @param int                     $expectedVersion
  * @param int                     $actualVersion
  */
 public function __construct(AggregateRootIdentifier $identifier, $expectedVersion, $actualVersion)
 {
     $this->identifier = $identifier;
     $this->expectedVersion = (int) $expectedVersion;
     $this->actualVersion = (int) $actualVersion;
     parent::__construct(sprintf('Got an unexpected version [%d] instead of [%d] for aggregate [%s].', $this->actualVersion, $this->expectedVersion, $identifier->toString()));
 }
Esempio n. 18
0
 public function __construct($message, $code = null, $previous = null)
 {
     if ($code === null) {
         $code = self::UNKNOWN_EXCEPTION;
     }
     parent::__construct($message, $code, $previous);
 }
Esempio n. 19
0
 /**
  * Constructor.
  *
  * @param string    $message  The exception message
  * @param string    $id       The identifier of the content where the exception was created
  * @param Exception $previous The previous exception
  */
 public function __construct($message, $id = null, \Exception $previous = null)
 {
     $this->rawMessage = $message;
     $this->id = $id;
     $this->updateRepr();
     parent::__construct($this->message, 0, $previous);
 }
Esempio n. 20
0
 public function __construct($message = "", $code = 403, Exception $previous = null)
 {
     if (empty($message)) {
         $message = \JText::_('LIB_FOF_CONTROLLER_ERR_LOCKED');
     }
     parent::__construct($message, $code, $previous);
 }
Esempio n. 21
0
 function __construct($message = '', $line = null, $code = null, \Exception $previous = null)
 {
     if ($line) {
         $message .= " at line {$line}";
     }
     parent::__construct(trim($message), $code, $previous);
 }
Esempio n. 22
0
 public function __construct(array $errors)
 {
     $details = array_map(function (LibXMLError $error) {
         return $error->message;
     }, $errors);
     parent::__construct('Failed loading XML: \\n' . implode('\\n', $details));
 }
Esempio n. 23
0
 /**
  * __construct
  *
  * @param string $type
  * @param string $message
  */
 public function __construct($type, $message, \Exception $previousException = null)
 {
     $this->type = $type ?: 'unknow type';
     $message = $message ?: 'no message provided';
     $message = sprintf('%s (%s)', $message, $this->type);
     parent::__construct($message, 0, $previousException);
 }
Esempio n. 24
0
 public function __construct($message = null, $code = null)
 {
     if (!$message && isset(static::$messages[$code])) {
         $message = static::$messages[$code];
     }
     parent::__construct($message, $code);
 }
 function __construct($message = '', $code = NULL, $previous = NULL)
 {
     if (!$message) {
         $message = "You have exceeded your storage capacity. Please remove some files and try again.";
     }
     parent::__construct($message, $code, $previous);
 }
 /**
  * @param UploadState      $state Upload state at time of the exception.
  * @param \Exception|array $prev  Exception being thrown.
  */
 public function __construct(UploadState $state, $prev = null)
 {
     $msg = 'An exception occurred while performing a multipart upload.';
     if (is_array($prev)) {
         $msg = strtr($msg, ['performing' => 'uploading parts to']);
         $msg .= " The following parts had errors:\n";
         /** @var $error AwsException */
         foreach ($prev as $part => $error) {
             $msg .= "- Part {$part}: " . $error->getMessage() . "\n";
         }
     } elseif ($prev instanceof AwsException) {
         switch ($prev->getCommand()->getName()) {
             case 'CreateMultipartUpload':
             case 'InitiateMultipartUpload':
                 $action = 'initiating';
                 break;
             case 'CompleteMultipartUpload':
                 $action = 'completing';
                 break;
         }
         if (isset($action)) {
             $msg = strtr($msg, ['performing' => $action]);
         }
     }
     if (!$prev instanceof \Exception) {
         $prev = null;
     }
     parent::__construct($msg, 0, $prev);
     $this->state = $state;
 }
Esempio n. 27
0
 public function __construct($message = "", $code = 500, Exception $previous = null)
 {
     if (empty($message)) {
         $message = \JText::_('LIB_FOF_MODEL_ERR_GET_NAME');
     }
     parent::__construct($message, $code, $previous);
 }
Esempio n. 28
0
 public function __construct($message = "", $code = 403, Exception $previous = null)
 {
     if (empty($message)) {
         $message = \JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN');
     }
     parent::__construct($message, $code, $previous);
 }
Esempio n. 29
0
 /**
  * Initializes exception.
  *
  * @param string $message Error message.
  * @param int $code Error code.
  * @param \Exception $previous Previous exception.
  * @version 0.0.1
  * @since 0.0.1
  */
 public function __construct($message = null, $code = null, \Exception $previous = null)
 {
     // detect POSIX error info
     $code = isset($code) ? $code : \posix_get_last_error();
     $message = isset($message) ? $message : \posix_strerr($code);
     parent::__construct($message, $code, $previous);
 }
Esempio n. 30
0
 public function __construct($message = '', $code = 500, Exception $previous = null)
 {
     if (empty($message)) {
         $message = \JText::_('LIB_FOF_HAL_ERR_INVALIDLINK');
     }
     parent::__construct($message, $code, $previous);
 }