yireo / magento2-whoops
Magento 2 module adding Whoops error handling
Package info
Type:magento2-module
pkg:composer/yireo/magento2-whoops
Requires
- filp/whoops: ^2.1
- magento/framework: ^102.0|^103.0
- magento/module-backend: ^102.0
- magento/module-config: ^101.2
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
This module adds Whoops error handling to Magento 2.
Installation
Use composer to install this extension. First make sure that Magento is installed via composer, and that there is a valid composer.json file present.
Next, install our module using the following command:
composer require --dev yireo/magento2-whoops
Next, install the new module into Magento itself:
./bin/magento module:enable Yireo_Whoops ./bin/magento setup:upgrade
Check whether the module is successfully installed in Admin > Stores > Configuration > Yireo > Yireo Whoops.
Manual copy
We recommend composer to install this package. However, if you want a manual copy instead, these are the steps:
- Upload the files in the
source/folder to the folderapp/code/Yireo/Whoopsof your site - Run
php -f bin/magento module:enable Yireo_Whoops - Run
php -f bin/magento setup:upgrade - Flush the Magento cache
Usage
This module replaces the default error and exception handling of Magento 2 with Whoops. If you want to know what Whoops is, check out their site. There is no further usage. This module replaces the default Magento\Framework\App\Http class with its own and then adds in Whoops. This means that whenever an exception or error is not caught in the code, it will be output using Whoops.
You can test this yourself by adding some dummy code somewhere in Magento 2:
trigger_error('test');
or:
throw new RuntimeException('test');
Testing
This repository contains some PHPUnit tests:
- Make sure Magento is installed with composer packages in
vendor/(aka viacomposer install) - Next, navigate to the repository of this extension
- Execute the following command, replacing
PATH_TO_MAGENTOwith the actual path to Magento:
phpunit -c dev/tests/unit/phpunit.xml --bootstrap PATH_TO_MAGENTO/vendor/autoload.php Test/Unit
PWA compatibility
This frontend extension will be completely replaced by React or Vue functionality, and therefore, this extension will not be made compatible with PWA.