Closed
Description
The function addProductAdvanced and the underlying functions return strings if an error occurred.
One example from Mage_Catalog_Model_Product_Type_Abstract::_prepareProduct:
try {
$options = $this->_prepareOptions($buyRequest, $product, $processMode);
} catch (Mage_Core_Exception $e) {
return $e->getMessage();
}
They should use exceptions instead - so a better handling of the different cases for an error can take place such as
- distinguishing between the different kinds of errors
- logging backtraces
As a result, parts like
if (is_string($cartCandidates)) {
return $cartCandidates;
}
can be omitted then because the exceptions are passed automatically.
Metadata
Metadata
Assignees
Labels
No labels
Activity