Search code examples
phpzend-frameworkpimcore

Throwing exceptions in pimcore


Does anyone know if there are 'pimcore-exceptions' or do I have to throw the Zend Framework- or PHP-exceptions?

I've scanned their GitHub-repository but found no hint.

Thanks!


Solution

  • There are only a couple of pimcore-specific exceptions (take a look at pimcore/config/autoload-classmap.php):

    • Pimcore\Tool\RestClient\Exception
    • Pimcore\Image\Matrixcode\Renderer\Exception
    • Pimcore\Image\Matrixcode\Qrcode\Exception
    • Pimcore\Image\Matrixcode\Exception
    • Pimcore\API\Plugin\Exception

    For common use cases stick to the Zend exceptions, using plain PHP exceptions (and/or define your onw) where none seem appropriate.