Skip to content

Commit 61a9c8d

Browse files
committed
MAGETWO-67722: Add ability to inject exception code in LocalizedException #9363
- Merge Pull Request #9363 from adragus-inviqa/magento2:patch-5
2 parents bbe3ee0 + 4162f32 commit 61a9c8d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/internal/Magento/Framework/Exception/LocalizedException.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,14 @@ class LocalizedException extends \Exception
2626
protected $logMessage;
2727

2828
/**
29-
* Constructor
30-
*
3129
* @param \Magento\Framework\Phrase $phrase
3230
* @param \Exception $cause
31+
* @param int $code
3332
*/
34-
public function __construct(Phrase $phrase, \Exception $cause = null)
33+
public function __construct(Phrase $phrase, \Exception $cause = null, $code = 0)
3534
{
3635
$this->phrase = $phrase;
37-
parent::__construct($phrase->render(), 0, $cause);
36+
parent::__construct($phrase->render(), intval($code), $cause);
3837
}
3938

4039
/**

0 commit comments

Comments
 (0)