PHPackages                             swoft/whoops - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. swoft/whoops

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

swoft/whoops
============

Whoops Component for Swoft

v2.0.11(5y ago)44.8k1Apache-2.0PHPPHP &gt;7.1

Since Jul 23Pushed 5y ago8 watchersCompare

[ Source](https://github.com/swoft-cloud/swoft-whoops)[ Packagist](https://packagist.org/packages/swoft/whoops)[ Docs](https://github.com/swoft-cloud/swoft)[ RSS](/packages/swoft-whoops/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (10)Used By (0)

Swoft Whoops
============

[](#swoft-whoops)

[![Latest Stable Version](https://camo.githubusercontent.com/5966362bad9a04d4a5a0a2de86a7a3831c1cae91dff8e6bb4fe903dfbe2951cf/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73776f66742f77686f6f70732e737667)](https://packagist.org/packages/swoft/whoops)[![Php Version](https://camo.githubusercontent.com/c197ef1e57a32c886b2a54d02ead7dbc035f18b3f39a642703b9372eef7819f9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d372e312d627269676874677265656e2e7376673f6d61784167653d32353932303030)](https://secure.php.net/)[![Swoft Doc](https://camo.githubusercontent.com/ea1431167b522b88916c717b0bfe6348328a8662a684bb128f0b0bd6d22a20d5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63732d70617373696e672d677265656e2e7376673f6d61784167653d32353932303030)](https://www.swoft.org/docs)[![Swoft License](https://camo.githubusercontent.com/1c419f89412ea6c234c184ad6d85decb127c18584858d3707ae7d8e2131eccc4/68747470733a2f2f696d672e736869656c64732e696f2f686578706d2f6c2f706c75672e7376673f6d61784167653d32353932303030)](https://github.com/swoft-cloud/swoft/blob/master/LICENSE)

Swoft http errors for cool kids by [filp/whoops](https://github.com/filp/whoops)

Install
-------

[](#install)

- composer command

```
composer require --dev swoft/whoops
```

Usage
-----

[](#usage)

- Method 1

Use the `Swoft\Whoops\WhoopsMiddleware` as an global middleware(`app/bean.php`):

```
    'httpDispatcher'   => [
        // Add global http middleware
        'middlewares' => [
            // Notice: Please add to the first place
            \Swoft\Whoops\WhoopsMiddleware::class,
        ],
    ],
```

- Method 2

Change the `App\Exception\Handler\HttpExceptionHandler` class:

```
