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);
 }
 /**
  * Constructor
  *
  * @param string $message Message text
  * @param int    $code    Error code
  *
  * @return void
  */
 public function __construct($message, $code = PHPCAS_SERVICE_PT_FAILURE)
 {
     // Warn if the code is not in our allowed list
     $ptCodes = array(PHPCAS_SERVICE_PT_FAILURE, PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE, PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE);
     if (!in_array($code, $ptCodes)) {
         trigger_error('Invalid code ' . $code . ' passed. Must be one of PHPCAS_SERVICE_PT_FAILURE, PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE, or PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE.');
     }
     parent::__construct($message, $code);
 }
Example #3
0
 /**
  * BadColumnException constructor
  *
  * Creates a new BadColumnException, which saves the table and column
  * name in question, and generates a default error message if
  * required.
  *
  * @param string $table The table which caused the error
  * @param string $column The column which caused the error
  * @param string $message The exception error message
  * @param int $code The exception code
  * @return BadColumnException
  */
 public function __construct($table, $column, $message = '', $code = 0)
 {
     $this->table = $table;
     $this->column = $column;
     if (!$message) {
         $message = "Column {$table}.{$column} does not exist.";
     }
     parent::__construct($message, $code);
 }
 /**
  * @inheritdoc
  *
  * @param string $method The method that is not defined.
  * @param string|object $class_or_instance The name of the class or one of its instances.
  * @param string|null $message If `null` a message is formatted with $method and $class.
  * @param int $code
  * @param \Exception $previous
  */
 public function __construct($method, $class_or_instance, $message = null, $code = 500, \Exception $previous = null)
 {
     $class = $class_or_instance;
     if (is_object($class_or_instance)) {
         $this->instance = $class_or_instance;
         $class = get_class($class_or_instance);
     }
     $this->method = $method;
     $this->class = $class;
     parent::__construct($message ?: $this->format_message($method, $class), $code, $previous);
 }
 public function __construct($message = null, $code = 101006, \Exception $previous = null, $httpStatus = 405, $details = null)
 {
     if ($code === null) {
         $code = 101006;
     }
     if ($httpStatus === null) {
         $httpStatus = 405;
     }
     $resolution = "Change either REST method or HTTP method, or both";
     $details = array_merge($details, compact('resolution'));
     parent::__construct($message, $code, $previous, $httpStatus, $details);
 }
 /**
  * @param string $message
  * @param int $code
  * @param \Exception|null $previous
  */
 public function __construct($message = "", $code = 0, \Exception $previous = null)
 {
     parent::__construct($this->getName() . ': ' . $message, 500);
 }
Example #7
0
 /**
  * @param string $message
  * @param \Exception $previous
  */
 public function __construct($message, \Exception $previous = null)
 {
     parent::__construct($message, 500, $previous);
 }
Example #8
0
 /**
  * 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());
 }
 /**
  * @param AstNode $visitSubject
  * @param string $message
  * @param int $code
  */
 public function __construct(AstNode $visitSubject, $message = "", $code = 0)
 {
     parent::__construct($message, $code);
     $this->visitSubject = $visitSubject;
 }
 /**
  * Конструктор
  * 
  */
 public function __construct($message, $code, $file, $line)
 {
     $this->file = $file;
     $this->line = $line;
     parent::__construct($message, $code);
 }
 public function __construct($message, $code, $previous)
 {
     parent::__construct($message, $code, $previous);
 }
 public function __construct($message = "Method not found", $code = -32601, Exception $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }
 public function __construct($message = 'The call to specified method is invalid because of argument mismatch', $code = 0, $previous = NULL)
 {
     parent::__construct($message, $code, $previous);
 }
 /**
  * Exception constructor.
  * 
  * @param string $method Not implemented method.
  * Typically this is __METHOD__ magic constant.
  */
 public function __construct($method)
 {
     parent::__construct("Method {$method} is not implemented.");
 }
 public function testConstruct()
 {
     $exception = new BadMethodCallException('Oops');
     $this->assertSame('Oops', $exception->getMessage());
 }
Example #16
0
 public function __construct($message = 'user is not allowed to create this class', $code = 0, $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }
Example #17
0
 /**
  * @inheritdoc
  *
  * @param string $method
  * @param object $instance
  * @param string|null $message
  * @param int $code
  * @param \Exception|null $previous
  */
 public function __construct($method, $instance, $message = null, $code = 500, \Exception $previous = null)
 {
     $this->method = $method;
     $this->instance = $instance;
     parent::__construct($message ?: $this->format_message($method, $instance), $code, $previous);
 }
 public function __construct($message = "", $code = 0, $previous = null)
 {
     parent::__construct($message, $code, $previous);
     //todo: generate error code.
 }
 /**
  * @param string    $method
  * @param int       $code
  * @param Exception $previous
  */
 public function __construct($method, $code = 0, Exception $previous = null)
 {
     parent::__construct(sprintf('Method "%s" cannot be called as this collection is immutable.', $method), $code, $previous);
 }
Example #20
0
 /**
  * @test
  */
 public function eventConvertExceptions()
 {
     $ed = \Mockery::mock('Symfony\\Component\\EventDispatcher\\EventDispatcher')->shouldReceive('dispatch')->withAnyArgs()->andReturnUsing(function ($eventName, Event $event) {
         if ($eventName == Event::EVENT_TRANSFORM_TEST_EXCEPTION) {
             $e = $event->getAttribute('exception');
             $e = new \BadMethodCallException($e->getMessage() . 'barbaz');
             $event->setAttribute('exception', $e);
         }
     })->mock();
     $setupBlock = \Mockery::mock(ThenBlock::clazz())->shouldReceive('compileCode')->once()->andReturn('throw new \\Exception("foo");')->mock();
     $spec = new Specification();
     $spec->setEventDispatcher($ed);
     $spec->setSetupBlock($setupBlock);
     try {
         $spec->run();
         $this->fail('Exception expected!');
     } catch (\BadMethodCallException $exc) {
         $this->assertEquals('foobarbaz', $exc->getMessage());
     }
 }
 /**
  * ControllerNotFoundException constructor.
  * @param string $message
  * @param int $code
  * @param \Exception|null $previous
  */
 public function __construct($message = "Controller Method Not Found", $code = 605, \Exception $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }
 public function __construct()
 {
     parent::__construct('Unable to change the values of a locked data structure (ValuesGroup and ValuesBag).');
 }
 /**
  * Constructor.
  *
  * @param string $methodName
  */
 public function __construct($methodName)
 {
     parent::__construct(sprintf('Impossible to call %s() on immutable parameter.', $methodName));
 }