PHPackages                             rudra/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rudra/exception

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rudra/exception
===============

Rudra framework

v26.7(1w ago)11.6k8MPL-2.0PHPPHP ^8.3CI passing

Since Jun 27Pushed 1w ago1 watchersCompare

[ Source](https://github.com/Jagepard/Rudra-Exception)[ Packagist](https://packagist.org/packages/rudra/exception)[ RSS](/packages/rudra-exception/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (4)Dependencies (6)Versions (6)Used By (8)

[![PHPunit](https://github.com/Jagepard/Rudra-Exception/actions/workflows/php.yml/badge.svg)](https://github.com/Jagepard/Rudra-Exception/actions/workflows/php.yml)[![Maintainability](https://camo.githubusercontent.com/446e99aff4c96eded18ee5c9602e72657f7ae5e054a3c78b806bdb0b3418f098/68747470733a2f2f716c74792e73682f6261646765732f61616338616431632d643139622d346263632d626332342d6436656162643336383836382f6d61696e7461696e6162696c6974792e737667)](https://qlty.sh/gh/Jagepard/projects/Rudra-Exception)[![CodeFactor](https://camo.githubusercontent.com/2c74749a216476aacfdee8f3e6742293328e4a497320fa1631d16d0f8bbbe85e/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f6a616765706172642f72756472612d657863657074696f6e2f6261646765)](https://www.codefactor.io/repository/github/jagepard/rudra-exception)[![Coverage Status](https://camo.githubusercontent.com/0c991b76fd155aed96c4a32ad36d5a335fa5b675ec507a3c6f560bb07ec881a2/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4a616765706172642f52756472612d457863657074696f6e2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/Jagepard/Rudra-Exception?branch=master)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#)

Rudra-Exception | [API](https://github.com/Jagepard/Rudra-Exception/blob/master/docs.md "Documentation API")
============================================================================================================

[](#rudra-exception--api)

#### Install

[](#install)

```
composer require rudra/exception
```

#### Usage

[](#usage)

##### Throwing HTTP Errors

[](#throwing-http-errors)

```
// Using abort() helper
abort(404);
abort(500, "Internal Server Error");

// Or directly
throw new RouterException("Not Found", 404);
throw new NotFoundException("Resource not found");
throw new LogicException("Invalid configuration");
```

#### Exception Hierarchy

[](#exception-hierarchy)

```
Throwable
└── RuntimeException
    └── RudraException
        ├── RouterException
        ├── LogicException
        │   └── MiddlewareException
        ├── NotFoundException
        └── RuntimeException

```

#### Configuration

[](#configuration)

##### Error Pages

[](#error-pages)

Configure error handlers in your `setting.{$env}.yml`:

```
http.errors:
    404:
        controller: App\Ship\Errors\Controller\HttpErrorsController
        action: error404
    503:
        controller: App\Ship\Errors\Controller\HttpErrorsController
        action: error503
```

#### DebugBar Integration

[](#debugbar-integration)

In development mode, exceptions are automatically logged to DebugBar:

```
if (Rudra::config()->get("environment") === "development") {
    $debugbar->addCollector(new DebugBar\DataCollector\ExceptionsCollector());
}
```

License
-------

[](#license)

This project is licensed under the **Mozilla Public License 2.0 (MPL-2.0)** — a free, open-source license that:

- Requires preservation of copyright and license notices,
- Allows commercial and non-commercial use,
- Requires that any modifications to the original files remain open under MPL-2.0,
- Permits combining with proprietary code in larger works.

📄 Full license text: [LICENSE](./LICENSE)
🌐 Official MPL-2.0 page:

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance98

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~90 days

Total

5

Last Release

10d ago

Major Versions

v25.12 → v26.12025-12-29

PHP version history (2 changes)v25.6PHP &gt;=8.3

v26.7PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/75e65761bdd94035d1c783773a706d5722ce3164fe55d9722581c2cb4a642d8c?d=identicon)[jagepard](/maintainers/jagepard)

---

Top Contributors

[![Jagepard](https://avatars.githubusercontent.com/u/4591345?v=4)](https://github.com/Jagepard "Jagepard (182 commits)")

---

Tags

exceptionexceptionsrudraexceptionexceptionsrudra

### Embed Badge

![Health badge](/badges/rudra-exception/health.svg)

```
[![Health](https://phpackages.com/badges/rudra-exception/health.svg)](https://phpackages.com/packages/rudra-exception)
```

###  Alternatives

[pear/pear_exception

The PEAR Exception base class.

9885.4M125](/packages/pear-pear-exception)[yireo/magento2-webp2

Magento 2 module to add WebP support to the Magento frontend

2111.3M7](/packages/yireo-magento2-webp2)[kdyby/strict-objects

Simple trait to make your class strict, when calling or accessing undefined member (property or method).

321.7M18](/packages/kdyby-strict-objects)[orisai/exceptions

Exceptions designed for static analysis and easy usage

22183.8k30](/packages/orisai-exceptions)[phpattempt/phpattempt

Helper function to enforce error-first approach in your code

1715.1k](/packages/phpattempt-phpattempt)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
