Skip to content

Commit 6b0ebf4

Browse files
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 04f60d5 commit 6b0ebf4

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;
@@ -548,15 +547,12 @@ protected function submitQuote(QuoteEntity $quote, $orderData = [])
548547
]
549548
);
550549
} catch (\Exception $consecutiveException) {
551-
$message = new Phrase(
552-
"An exception occurred on 'sales_model_service_quote_submit_failure' event: %1\n%2",
553-
[
554-
$consecutiveException->getMessage(),
555-
$consecutiveException->getTraceAsString()
556-
]
550+
$message = sprintf(
551+
"An exception occurred on 'sales_model_service_quote_submit_failure' event: %s",
552+
$consecutiveException->getMessage()
557553
);
558554

559-
throw new LocalizedException($message, $e);
555+
throw new \Exception($message, 0, $e);
560556
}
561557
throw $e;
562558
}

0 commit comments

Comments
 (0)