Skip to content

Commit

Permalink
amend consecutive exception handling
Browse files Browse the repository at this point in the history
- support masking of root cause in frontend
- remove stack trace for consecutive exception to comply to default behaviour
  • Loading branch information
david-fuehr authored and Lars Roettig committed Mar 29, 2019
1 parent d91acbe commit 9141077
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions app/code/Magento/Quote/Model/QuoteManagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use Magento\Framework\Exception\CouldNotSaveException;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Exception\StateException;
use Magento\Framework\Phrase;
use Magento\Quote\Api\Data\PaymentInterface;
use Magento\Quote\Model\Quote\Address\ToOrder as ToOrderConverter;
use Magento\Quote\Model\Quote\Address\ToOrderAddress as ToOrderAddressConverter;
Expand Down Expand Up @@ -545,15 +544,12 @@ protected function submitQuote(QuoteEntity $quote, $orderData = [])
]
);
} catch (\Exception $consecutiveException) {
$message = new Phrase(
"An exception occurred on 'sales_model_service_quote_submit_failure' event: %1\n%2",
[
$consecutiveException->getMessage(),
$consecutiveException->getTraceAsString()
]
$message = sprintf(
"An exception occurred on 'sales_model_service_quote_submit_failure' event: %s",
$consecutiveException->getMessage()
);

throw new LocalizedException($message, $e);
throw new \Exception($message, 0, $e);
}
throw $e;
}
Expand Down

0 comments on commit 9141077

Please sign in to comment.