Skip to content

Commit 9141077

Browse files
david-fuehrLars Roettig
authored and
Lars Roettig
committed
amend consecutive exception handling
- support masking of root cause in frontend - remove stack trace for consecutive exception to comply to default behaviour
1 parent d91acbe commit 9141077

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

app/code/Magento/Quote/Model/QuoteManagement.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Magento\Framework\Exception\CouldNotSaveException;
1313
use Magento\Framework\Exception\LocalizedException;
1414
use Magento\Framework\Exception\StateException;
15-
use Magento\Framework\Phrase;
1615
use Magento\Quote\Api\Data\PaymentInterface;
1716
use Magento\Quote\Model\Quote\Address\ToOrder as ToOrderConverter;
1817
use Magento\Quote\Model\Quote\Address\ToOrderAddress as ToOrderAddressConverter;
@@ -545,15 +544,12 @@ protected function submitQuote(QuoteEntity $quote, $orderData = [])
545544
]
546545
);
547546
} catch (\Exception $consecutiveException) {
548-
$message = new Phrase(
549-
"An exception occurred on 'sales_model_service_quote_submit_failure' event: %1\n%2",
550-
[
551-
$consecutiveException->getMessage(),
552-
$consecutiveException->getTraceAsString()
553-
]
547+
$message = sprintf(
548+
"An exception occurred on 'sales_model_service_quote_submit_failure' event: %s",
549+
$consecutiveException->getMessage()
554550
);
555551

556-
throw new LocalizedException($message, $e);
552+
throw new \Exception($message, 0, $e);
557553
}
558554
throw $e;
559555
}

0 commit comments

Comments
 (0)