/**
  * @param \Magento\Framework\Phrase $phrase
  * @param \Exception $cause
  */
 public function __construct(Phrase $phrase = null, \Exception $cause = null)
 {
     if ($phrase === null) {
         $phrase = new Phrase('Store is inactive');
     }
     parent::__construct($phrase, $cause);
 }
 /**
  * @param \Magento\Framework\Phrase $phrase
  * @param \Exception $cause
  */
 public function __construct(Phrase $phrase = null, \Exception $cause = null)
 {
     if ($phrase === null) {
         $phrase = new Phrase('One or more input exceptions have occurred.');
     }
     parent::__construct($phrase, $cause);
 }
 /**
  * @param \Magento\Framework\Phrase $phrase
  * @param \Exception $cause
  */
 public function __construct(Phrase $phrase = null, \Exception $cause = null)
 {
     if ($phrase === null) {
         $phrase = new Phrase(self::DEFAULT_MESSAGE);
     }
     parent::__construct($phrase, $cause);
 }
 /**
  * @param \Magento\Framework\Phrase $phrase
  * @param \Exception $cause
  */
 public function __construct(Phrase $phrase = null, \Exception $cause = null)
 {
     if ($phrase === null) {
         $phrase = new Phrase('No such entity.');
     }
     parent::__construct($phrase, $cause);
 }
Esempio n. 5
0
 /**
  * Constructor
  *
  * @param \Magento\TestFramework\Performance\Scenario $scenario
  * @param Phrase $phrase
  */
 public function __construct(\Magento\TestFramework\Performance\Scenario $scenario, Phrase $phrase = null)
 {
     if ($phrase === null) {
         $phrase = new Phrase('Scenario failure.');
     }
     parent::__construct($phrase);
     $this->_scenario = $scenario;
 }
Esempio n. 6
0
 /**
  * Initialize exception with HTTP code.
  *
  * @param \Magento\Framework\Phrase $phrase
  * @param int $code Error code
  * @param int $httpCode
  * @param array $details Additional exception details
  * @param string $name Exception name
  * @param \Magento\Framework\Exception\LocalizedException[]|null $errors Array of errors messages
  * @param string $stackTrace
  *
  * @throws \InvalidArgumentException
  */
 public function __construct(Phrase $phrase, $code = 0, $httpCode = self::HTTP_BAD_REQUEST, array $details = [], $name = '', $errors = null, $stackTrace = null)
 {
     /** Only HTTP error codes are allowed. No success or redirect codes must be used. */
     if ($httpCode < 400 || $httpCode > 599) {
         throw new \InvalidArgumentException(sprintf('The specified HTTP code "%d" is invalid.', $httpCode));
     }
     parent::__construct($phrase);
     $this->code = $code;
     $this->_httpCode = $httpCode;
     $this->_details = $details;
     $this->_name = $name;
     $this->_errors = $errors;
     $this->_stackTrace = $stackTrace;
 }
Esempio n. 7
0
 /**
  * Обратите внимание, что PHP разрешает сигнатуре конструктора класса-потомка
  * отличаться от сигнатуры конструктора класса родителя:
  * http://3v4l.org/qQdJ3
  * @param mixed ...$args
  */
 public function __construct(...$args)
 {
     /** @var string|Phrase|E|array(string => mixed)|null $arg0 */
     $arg0 = dfa($args, 0);
     /** @var E|LE|null $prev */
     $prev = null;
     /** @var Phrase|null $message */
     $message = null;
     // 2015-10-10
     if (is_array($arg0)) {
         $this->_data = $arg0;
     } else {
         if ($arg0 instanceof Phrase) {
             $message = $arg0;
         } else {
             if (is_string($arg0)) {
                 $message = __($arg0);
             } else {
                 if ($arg0 instanceof E) {
                     $prev = $arg0;
                 }
             }
         }
     }
     /** @var int|string|E|Phrase|null $arg1 */
     $arg1 = dfa($args, 1);
     if (!is_null($arg1)) {
         if ($arg1 instanceof E) {
             $prev = $arg1;
         } else {
             if (is_int($prev)) {
                 $this->_stackLevelsCountToSkip = $arg1;
             } else {
                 if (is_string($arg1) || $arg1 instanceof Phrase) {
                     $this->comment((string) $arg1);
                 }
             }
         }
     }
     if (is_null($message)) {
         $message = __($prev ? df_ets($prev) : 'No message');
     }
     parent::__construct($message, $prev);
 }
Esempio n. 8
0
 /**
  * Constructor
  *
  * @param \Magento\Framework\Phrase $phrase
  */
 public function __construct(\Magento\Framework\Phrase $phrase, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig)
 {
     parent::__construct($phrase);
     $this->_scopeConfig = $scopeConfig;
 }
 /**
  * @return void
  */
 public function testGetLogMessage()
 {
     $message = 'message %1 %2';
     $params = ['parameter1', 'parameter2'];
     $cause = new \Exception();
     $localizeException = new LocalizedException(new Phrase($message, $params), $cause);
     $expectedLogMessage = 'message parameter1 parameter2';
     $this->assertEquals($expectedLogMessage, $localizeException->getLogMessage());
 }
 /**
  * Constructor
  *
  * @param \Magento\Framework\Phrase $phrase
  * @param \Exception $cause
  * @param int $code
  */
 public function __construct(Phrase $phrase, \Exception $cause = null, $code = 0)
 {
     parent::__construct($phrase, $cause);
     $this->code = $code;
 }
 /**
  * Initialize the exception
  *
  * @param \Magento\Framework\Phrase $phrase
  * @param \Exception $cause
  */
 public function __construct(Phrase $phrase, \Exception $cause = null)
 {
     $this->originalPhrase = $phrase;
     parent::__construct($phrase, $cause);
 }
 /**
  * Constructor
  *
  * @param array $conflictingSynonyms
  * @param Phrase|null $phrase
  * @param \Exception|null $cause
  */
 public function __construct(array $conflictingSynonyms, Phrase $phrase = null, \Exception $cause = null)
 {
     parent::__construct($phrase, $cause);
     $this->conflictingSynonyms = $conflictingSynonyms;
 }
Esempio n. 13
0
 /**
  * @param string $message
  * @param array $params
  * @param \Exception $cause
  */
 public function __construct($message = 'No such entity.', array $params = [], \Exception $cause = null)
 {
     parent::__construct($message, $params, $cause);
 }