コード例 #1
0
ファイル: NoAssetKey.php プロジェクト: Joal01/fof
 public function __construct($message = '', $code = 500, Exception $previous = null)
 {
     if (empty($message)) {
         $message = \JText::_('LIB_FOF_MODEL_ERR_NOASSETKEY');
     }
     parent::__construct($message, $code, $previous);
 }
コード例 #2
0
 public function __construct($message = "", $code = 0, \Exception $previous = null)
 {
     // We can only use pg_result_error_field() with async queries, so just parse the message
     // instead. See function pqGetErrorNotice3() in src/interfaces/libpq/fe-protocol3.c
     if (preg_match("/^[^\\r\\n]+:  ([A-Z0-9]{5}):/", $message, $m)) {
         $this->_sqlState = $m[1];
     }
     parent::__construct($message, $code, $previous);
 }
コード例 #3
0
 /**
  * @param string    $filterName
  * @param Exception $previous
  */
 public function __construct($filterName, Exception $previous = null)
 {
     $this->filterName = $filterName;
     $message = sprintf('Unknown filter: %s', $filterName);
     if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
         parent::__construct($message, 0, $previous);
     } else {
         parent::__construct($message);
     }
 }
コード例 #4
0
 public function __construct($message = null, $response = null)
 {
     if (empty($message)) {
         $message = 'Desk.com API call failed';
     }
     if ($response instanceof Response) {
         $response = $response->getBody();
     } else {
         if (!is_string($response)) {
             $response = null;
         }
     }
     if (!empty($response)) {
         $message .= ' -- Full response body: ' . (string) $response;
     } else {
         $message .= ' -- No response body received';
     }
     parent::__construct($message);
 }
コード例 #5
0
 public function __construct($physicalMessageId, \Exception $previous = null)
 {
     parent::__construct("An error occurred while attempting to extract a logical message from the physical message with ID '{$physicalMessageId}'", 0, $previous);
 }
コード例 #6
0
 /**
  * @param mixed      $keyType
  * @param int        $code
  * @param \Exception $previous
  */
 public function __construct($keyType, $code = 0, \Exception $previous = null)
 {
     parent::__construct(sprintf('Variables of type "%s" cannot be used as keys.', $keyType), $code, $previous);
 }
コード例 #7
0
ファイル: NoContentType.php プロジェクト: akeeba/fof
 public function __construct($className, $code = 500, Exception $previous = null)
 {
     $message = \JText::sprintf('LIB_FOF_MODEL_ERR_NOCONTENTTYPE', $className);
     parent::__construct($message, $code, $previous);
 }
コード例 #8
0
 public function __construct($code = 0)
 {
     parent::__construct('DocRaptor returned an unexpected response (' . $code . ')', $code);
 }
コード例 #9
0
 /**
  * @param string $message
  * @param Error[] $errors
  */
 public function __construct($message, $errors)
 {
     parent::__construct($message);
     $this->errors = $errors;
 }
コード例 #10
0
 public function __construct($reference, $code = 0)
 {
     BaseException::__construct("Storage item not found with this reference: {$reference}", $code);
 }
コード例 #11
0
ファイル: Exception.php プロジェクト: bluesnowman/fphp-saber
 /**
  * This constructor creates a new runtime exception.
  *
  * @access public
  * @param string $message                                   the error message
  * @param array $values                                     the value to be formatted
  * @param IInt32\Type $code                                  the exception code
  */
 public function __construct($message = '', array $values = null, IInt32\Type $code = null)
 {
     parent::__construct(empty($values) ? (string) $message : strtr((string) $message, $values), IInt32\Module::nvl($code)->unbox());
 }
コード例 #12
0
 /**
  * Constructor.
  *
  * @param string    $address   The email address that fails its verification.
  * @param Diagnosis $diagnosis The diagnosis
  * @param Exception $previous  The previous exception used for the exception chaining.
  */
 public function __construct($address, Diagnosis $diagnosis, \Exception $previous = null)
 {
     parent::__construct(sprintf('Invalid email address "%s": %s', $address, $diagnosis->description), $diagnosis->severity, $previous);
 }
コード例 #13
0
ファイル: Adapter.php プロジェクト: voidcontext/filesystem
 protected function executeDelayedCall($function, $args, $errorResultCode, Deferred $deferred)
 {
     $this->register();
     $args[] = EIO_PRI_DEFAULT;
     $args[] = function ($data, $result, $req) use($deferred, $errorResultCode, $function, $args) {
         if ($result == $errorResultCode) {
             $exception = new UnexpectedValueException(@eio_get_last_error($req));
             $exception->setArgs($args);
             $deferred->reject($exception);
             return;
         }
         $deferred->resolve($result);
     };
     if (!call_user_func_array($function, $args)) {
         $name = $function;
         if (!is_string($function)) {
             $name = get_class($function);
         }
         $exception = new RuntimeException('Unknown error calling "' . $name . '"');
         $exception->setArgs($args);
         $deferred->reject($exception);
     }
 }
コード例 #14
0
 public function __construct($message = 'Unexpected value returned by internal call', $code = 0, $previous = NULL)
 {
     parent::__construct($message, $code, $previous);
 }
コード例 #15
0
 /**
  * The constructor does what you would expect it to.
  *
  * @author Daniel Sherman
  * @param string $message the message for the exception
  * @param integer $code the code for the exception
  * @param \Exception $previous A previous exception
  * @param array $context the array that will be returned along with the
  * exception.
  * @uses setId
  * @uses context
  */
 public function __construct($message = null, $code = 0, $previous = null, array $context = [])
 {
     parent::__construct($message, $code, $previous);
     $this->setId();
     $this->context = $context;
 }
コード例 #16
0
 public function __construct($message, $context = null)
 {
     $context = !is_null($context) ? "\n" . self::ARGUMENT . '"' . $context . '"' : null;
     parent::__construct('Detected invalid ' . $message . $context);
 }
コード例 #17
0
 public function __construct(\Exception $previous = null)
 {
     parent::__construct('Attempted dividing by zero.', 0, $previous);
 }
コード例 #18
0
ファイル: JsonError.php プロジェクト: fluentdom/fluentdom
 /**
  * @param int $code
  */
 public function __construct($code)
 {
     parent::__construct(isset($this->_jsonErrors[$code]) ? $this->_jsonErrors[$code] : $this->_jsonErrors[-1], $code);
 }
コード例 #19
0
 public function __construct($message = "", $code = 0, $previous = null)
 {
     parent::__construct($message, $code, $previous);
     //todo: generate error code.
 }
コード例 #20
0
 public function __construct()
 {
     parent::__construct('Can not store value', self::CANNOT_STORE);
 }
コード例 #21
0
ファイル: NoSerializer.php プロジェクト: fluentdom/fluentdom
 public function __construct($contentType)
 {
     parent::__construct(sprintf('No serializer for content type %s available.', $contentType));
 }
コード例 #22
0
 /**
  * @param string $returnedType
  * @param int $code
  * @param \Exception|null
  */
 public function __construct($returnedType, $code = 0, $previous = null)
 {
     $message = 'Function "modifyField" closure argument is expected to return a StoutLogic\\AcfBuilder\\FieldsBuilder, ' . $returnedType . ' returned instead.';
     parent::__construct(trim($message), $code, $previous);
 }
コード例 #23
0
 /**
  * @param mixed  $value
  * @param string $expectedType
  */
 public function __construct($value, $expectedType)
 {
     parent::__construct(sprintf('Expected argument of type "%s", "%s" given', $expectedType, is_object($value) ? get_class($value) : gettype($value)));
 }
コード例 #24
0
ファイル: TreeIncompatibleTable.php プロジェクト: Joal01/fof
 public function __construct($tableName, $code = 500, Exception $previous = null)
 {
     $message = \JText::sprintf('LIB_FOF_MODEL_ERR_TREE_INCOMPATIBLETABLE', $tableName);
     parent::__construct($message, $code, $previous);
 }
コード例 #25
0
 public function __construct($filterName)
 {
     $this->filterName = $filterName;
     parent::__construct(sprintf('Unknown filter: %s', $filterName));
 }
コード例 #26
0
 public function __construct($contentType, $class)
 {
     parent::__construct(sprintf('Invalid serializer for content type %s, instances of %s are not castable to string.', $contentType, $class));
 }
コード例 #27
0
 public function __construct($name, $value, $expectedType)
 {
     parent::__construct(sprintf('Expected %s to have type "%s" but found "%s"', $name, $expectedType, is_object($value) ? get_class($value) : gettype($value)));
 }
コード例 #28
0
ファイル: exceptions.php プロジェクト: kdyby/autowired
 public function __construct($message = "", \Reflector $reflector = NULL, $previous = NULL)
 {
     parent::__construct($message, $previous ? $previous->getCode() : 0, $previous);
     $this->reflector = $reflector;
 }
コード例 #29
-1
 /**
  * @param string $expected Expected type
  * @param mixed $value Received value
  * @param boolean $native Expected a native type?
  * @param \Exception $previous
  */
 public function __construct($expected, $value, $native = false, \Exception $previous = null)
 {
     $valType = is_object($value) ? get_class($value) . ' instance' : gettype($value);
     $expType = $expected . ($native ? ' value' : ' instance');
     $message = sprintf('Expected %s, but received %s', $expType, $valType);
     parent::__construct($message, 0, $previous);
 }
コード例 #30
-4
 /**
  * Constructs a library exception.
  *
  * @param \Drupal\libraries\ExternalLibrary\ExternalLibraryInterface $library
  *   The library with the invalid dependency.
  * @param \Drupal\libraries\ExternalLibrary\ExternalLibraryInterface $dependency
  *   The dependency.
  * @param string $message
  *   (optional) The exception message.
  * @param int $code
  *   (optional) The error code.
  * @param \Exception $previous
  *   (optional) The previous exception.
  */
 public function __construct(ExternalLibraryInterface $library, ExternalLibraryInterface $dependency, $message = '', $code = 0, \Exception $previous = NULL)
 {
     $this->library = $library;
     $this->dependency = $dependency;
     $message = $message ?: "The library '{$this->library->getId()}' cannot depend on the library '{$this->dependency->getId()}'.";
     parent::__construct($message, $code, $previous);
 }