public function testStackTraceResult()
 {
     $exception = new \DomainException();
     $encoder = new Understand\UnderstandLaravel5\ExceptionEncoder();
     $originalStackTrace = $exception->getTrace();
     $stackTraceArray = $encoder->stackTraceToArray($originalStackTrace);
     $this->assertSame(count($originalStackTrace), count($stackTraceArray));
     $this->assertSame($originalStackTrace[0]['function'], $stackTraceArray[0]['function']);
     $this->assertSame($originalStackTrace[0]['class'], $stackTraceArray[0]['class']);
 }
 public function __construct($message = NULL, $code = 500, \Exception $previous = NULL)
 {
     if (NULL === $message) {
         $message = 'Aggregating entity must be instance of AggregateRootInterface';
     }
     parent::__construct($message, $code, $previous);
 }
Example #3
0
 /**
  * DomainException constructor.
  *
  * @param string $providedValue The provided value that caused the exception
  * @param string $currentDomain The current domain that should contain the provided value
  * @param string $previous The previous exception, if any
  */
 public function __construct($providedValue, $currentDomain, $previous = null)
 {
     $this->setProvidedValue($providedValue);
     $this->setCurrentDomain($currentDomain);
     $this->setMessage();
     parent::__construct($this->message, $this->code, $previous);
 }
 public function __construct($message = NULL, $code = 500, \Exception $previous = NULL)
 {
     if (NULL === $message) {
         $message = 'This method must be called via aggregating root';
     }
     parent::__construct($message, $code, $previous);
 }
 public function __construct(ValidatorInterface $validator, $rules)
 {
     $this->name = get_class($validator);
     $this->rules = $rules;
     $message = sprintf('Validator [%s] has no supplied %s rules.', $this->name, $this->rules);
     parent::__construct($message);
 }
 /**
  * @param string[] $messages
  */
 public function __construct($messages)
 {
     // DEBUG
     //var_dump($messages);
     //die();
     parent::__construct(sprintf('Invalid transaction. %s', implode(' ', $messages)));
 }
 public function __construct($message = null, $code = 0, \Exception $previous = null, $httpStatus = 500, $details = null)
 {
     $this->_httpStatus = $httpStatus;
     if ($details !== null) {
         $this->_details = $details;
     }
     parent::__construct($message, $code, $previous);
 }
Example #8
0
 /**
  * Constructor.
  *
  * @param string    $message
  * @param string    $key
  * @param string    $filename
  * @param Exception $previous
  */
 public function __construct($message, $key = null, $filename = null, \Exception $previous = null)
 {
     $this->rawMessage = $message;
     $this->filename = $filename;
     $this->key = $key;
     $this->updateRepr();
     parent::__construct($this->message, 0, $previous);
 }
 /**
  * @param mixed          $givenValue
  * @param int[]|string[] $expectedValues
  * @throws \InvalidArgumentException
  */
 public function __construct($givenValue, array $expectedValues)
 {
     Assert::assert($expectedValues, 'expectedValues')->notEmpty();
     foreach ($expectedValues as $value) {
         if (!is_int($value) && !is_string($value)) {
             throw new \InvalidArgumentException(sprintf('Unexpected value in $expectedValues, allowed int, string. Given "%s"', gettype($value)));
         }
     }
     $message = sprintf('Value must be one from ["%s"]. Actual value: "%s"', implode('", "', $expectedValues), print_r($givenValue, true));
     parent::__construct($message);
 }
 /**
  * Invalid email Exception
  *
  * @param string $email
  * @param int $code
  * @param \Exception $previous
  */
 public function __construct($email, $code = 0, \Exception $previous = NULL)
 {
     parent::__construct($this->_buildMessage($email), $code, $previous);
 }
 /**
  * @param ThemeInterface[] $themes
  * @param \Exception $previous
  */
 public function __construct(array $themes, \Exception $previous = null)
 {
     $cycle = $this->getCycleFromArray($themes);
     $message = sprintf('Circular dependency was found while resolving theme "%s", caused by cycle "%s".', reset($themes)->getName(), $this->formatCycleToString($cycle));
     parent::__construct($message, 0, $previous);
 }
 /**
  * @param Username $username
  */
 public function __construct(Username $username, $message)
 {
     $this->username = $username;
     parent::__construct($message);
 }
 /**
  * Invalid URL Exception
  *
  * @param string $customFieldName
  * @param int $code
  * @param \Exception $previous
  */
 public function __construct($customFieldName, $code = 0, \Exception $previous = NULL)
 {
     parent::__construct($this->_buildMessage($customFieldName), $code, $previous);
 }
 public function __construct($name)
 {
     parent::__construct(sprintf('Temporary file with name "%s" is not found.', $name));
 }
 /**
  * Constructor
  *
  * @param   \JHttpResponse  $response  The Response object.
  * @param   string          $message   The Exception message to throw.
  * @param   integer         $code      The Exception code.
  * @param   \Exception      $previous  The previous exception used for the exception chaining.
  *
  * @since   3.0.0
  */
 public function __construct(\JHttpResponse $response, $message = '', $code = 0, \Exception $previous = null)
 {
     parent::__construct($message, $code, $previous);
     $this->response = $response;
 }
Example #16
0
 /**
  * Constructor
  *
  * @param string $message
  * @param string $usage
  * @return void
  */
 public function __construct($message, $usage = '')
 {
     $this->usage = $usage;
     parent::__construct($message);
 }
Example #17
0
 /**
  * @param Token           $token
  * @param string          $message
  * @param \Exception|null $previous
  */
 public function __construct(Token $token, $message = 'Invalid token.', \Exception $previous = null)
 {
     $this->token = $token;
     parent::__construct($message, 0, $previous);
 }
 /**
  * @param string $message
  * @param Request $request
  * @param Route[] $routes
  */
 public function __construct($message, Request $request, array $routes)
 {
     $this->setRequest($request);
     $this->setRoutes($routes);
     parent::__construct($message . $this->buildAdditionalMessage());
 }
Example #19
0
 /**
  * Конструктор
  * 
  */
 public function __construct($message, $code, $file, $line)
 {
     $this->file = $file;
     $this->line = $line;
     parent::__construct($message, $code);
 }
 public function __construct($message, $code = 0, \Exception $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }
 /**
  * @param string $path
  * @since 8.2.0
  */
 public function __construct($path)
 {
     parent::__construct('Autoload path not allowed: ' . $path);
 }
 public function __construct($accessToken)
 {
     parent::__construct(sprintf('Bgy\\OAuth2 Refresh Token "%s" not found', $accessToken));
 }
Example #23
0
 public function __construct($message = '', $code = 0, array $errors = null, \Excpetion $previous = null)
 {
     parent::__construct($message, $code, $previous);
     $this->errors = $errors;
 }
Example #24
0
 public function __construct($key)
 {
     parent::__construct("Attempted to access non-existent config parameter: {$key}");
 }
 public function __construct($payload, $message = '', $code = 0, \Exception $previous = null)
 {
     $this->payload = $payload;
     parent::__construct($message, $code, $previous);
 }
 function __construct($key, $namespace)
 {
     parent::__construct(sprintf('Element with key [%s] not found in namespace [%s]', $key, $namespace));
     $this->key = $key;
     $this->namespace = $namespace;
 }
 public function __construct($message, \Traversable $errors)
 {
     parent::__construct($message, 400);
     $this->errors = $errors;
 }
 /**
  * @param Event $event
  * @param AggregateRoot $aggregateRoot
  */
 public function __construct(Event $event, AggregateRoot $aggregateRoot)
 {
     parent::__construct(sprintf(static::$messageTemplate, $event->getEventName(), get_class($aggregateRoot)));
 }
 public function __construct($name)
 {
     parent::__construct(sprintf('Temporary images with name "%s" are not found.', $name));
 }
 /**
  * @param Identity $aggregateId
  */
 public function __construct(Identity $aggregateId)
 {
     parent::__construct(sprintf(static::$messageTemplate, $aggregateId->getValue()));
 }