PHPackages                             radnan/rdn-exception - 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. radnan/rdn-exception

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

radnan/rdn-exception
====================

Zend Framework 2 module to normalize errors and exceptions

v1.3.2(11y ago)038MITPHP

Since Dec 30Pushed 11y ago1 watchersCompare

[ Source](https://github.com/radnan/rdn-exception)[ Packagist](https://packagist.org/packages/radnan/rdn-exception)[ RSS](/packages/radnan-rdn-exception/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (9)Versions (8)Used By (0)

RdnException
============

[](#rdnexception)

The **RdnException** ZF2 module normalizes all framework errors to use native PHP Exceptions.

Two exception classes to handle HTTP response are included with the module:

- `RdnException\AccessDeniedException` - Throwing this exception will result in a **403** response.
- `RdnException\BadGatewayException` - Throwing this exception will result in a **502** response.
- `RdnException\BadRequestException` - Throwing this exception will result in a **400** response.
- `RdnException\MethodNotAllowedException` - Throwing this exception will result in a **405** response.
- `RdnException\NotFoundException` - Throwing this exception will result in a **404** response.
- `RdnException\UnauthorizedException` - Throwing this exception will result in a **401** response.
- `RdnException\UnprocessableEntityException` - Throwing this exception will result in a **422** response.

All other exceptions will result in a **500** response.

Additionally a third class `RdnException\PublicException` is included for cases where you'd like to display the exception message to the user. All HTTP exceptions extend from this class.

How to install
--------------

[](#how-to-install)

1. Use `composer` to require the `radnan/rdn-exception` package:

    ```
    $ composer require radnan/rdn-exception:1.*
    ```
2. Activate the module by including it in your `application.config.php` file:

    ```
