Shows clear, detailed error pages with the cause and the affected code while a store runs in developer mode, to find and fix errors faster. The pages come from the open-source library Whoops.
- In developer mode, an exception or error of a request shows the page of Whoops with the message, the code around the location and every call that led to it, along with the details of the request.
- AJAX requests get the same information as JSON, so that it can be read in the network tab of the browser. REST and GraphQL answer most errors with their own JSON; errors they do not catch, like fatal errors, are shown by Whoops as JSON too.
- Fatal errors, which end a request at once (for example an exceeded time limit), are shown the same way when PHP shuts down. When a request runs out of memory, a short text with the location is shown instead, because the page would need more memory.
- In production and default mode, the pages of Whoops are never shown. Errors are left to Magento, and fatal errors get a short note to check the PHP log instead of an empty page.
- The module hooks into
Magento\Framework\App\Http::launch(), so it covers the storefront, the admin and the APIs.
In developer mode, these addresses of the storefront cause an error on purpose, to check how errors are shown. In other modes, they show the page "not found".
| Address | Error |
|---|---|
/whoops/exception |
an exception |
/whoops/throwable |
an error that is no exception (\Error) |
/whoops/error |
a PHP warning, which Magento turns into an exception |
/whoops/fatal |
a fatal error: the request exceeds a time limit of one second |
/whoops/memory |
a fatal error: the request runs out of memory |
There are no settings. The pages are active as soon as the store runs in developer mode
(bin/magento deploy:mode:set developer).
- Magento Open Source or Adobe Commerce 2.4.6 or newer
- PHP 8.1 or newer
composer require infrangible/m2-whoops
bin/magento module:enable Infrangible_Whoops
bin/magento setup:upgradeIn production mode, also run bin/magento setup:di:compile.
Infrangible Whoops is licensed under the MIT License - see the LICENSE file for details.