Skip to content

Exception is created but not thrown #6320

Closed
@AppChecker

Description

@AppChecker

Hello!

  1. In method Collection::filterByProductType:
      if (!is_string($typeFilter) && !is_array($typeFilter)) {
            new \Magento\Framework\Exception\LocalizedException(__('The product type filter specified is incorrect.'));
        }

\Magento\Framework\Exception\LocalizedException is created but not thrown.
Is "throw" keyword missing?

  1. In method AbstractProduct::getModel:
        try {
            $model = $this->_indexFactory->get($this->_indexType);
        } catch (\InvalidArgumentException $e) {
            new \Magento\Framework\Exception\LocalizedException(__('Index type is not valid'));
        }

\Magento\Framework\Exception\LocalizedException is created but not thrown.

These possible defects found by static analyzer AppChecker

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fixed in 2.2.xThe issue has been fixed in 2.2 release lineIssue: Format is not validGate 1 Failed. Automatic verification of issue format is failedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releasebug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions