PHPackages                             neam/yii-dna-debug-modes-and-error-handling - 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. neam/yii-dna-debug-modes-and-error-handling

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

neam/yii-dna-debug-modes-and-error-handling
===========================================

Provides easy debug of redirects and general application flow through logs as well as user and developer friendly error handling in production.

1936PHP

Since Oct 7Pushed 10y ago1 watchersCompare

[ Source](https://github.com/neam/yii-dna-debug-modes-and-error-handling)[ Packagist](https://packagist.org/packages/neam/yii-dna-debug-modes-and-error-handling)[ RSS](/packages/neam-yii-dna-debug-modes-and-error-handling/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Yii DNA Debug Modes and Error Handling
======================================

[](#yii-dna-debug-modes-and-error-handling)

Provides easy debug of redirects and general application flow through logs as well as user and developer friendly error handling in production.

Error Handling
--------------

[](#error-handling)

Features:

- Sentry integration
- Friendly errors, including proper catching of fatal errors. Users are informed that an error report has been sent to our technicians and reported sentry event ids are displayed for the end user to include in support requests
- Overrides the insecure default displayError and displayException that could be exploited for Cross-Site Scripting attacks.
- The SaveException class for getting useful exception messages when $model-&gt;save() return false

Requires that the `SENTRY_DSN` constant is set containing the Sentry dsn to use when reporting errors.

Debug Modes
-----------

[](#debug-modes)

The modes are activated when the corresponding PHP constants are defined and `true`.

### DEBUG\_REDIRECTS

[](#debug_redirects)

Will pause and let you manually click the new url that. This way logs can be inspected before the redirect is performed.

### DEBUG\_LOGS

[](#debug_logs)

Will enable the web log route on non-ajax requests together with some $\_GET options that let's the developer fine tune what logs are displayed.

Installation
------------

[](#installation)

### Error Handling

[](#error-handling-1)

In your main configuration file, make sure that the current configuration is available in a variable called `$config`, then include this extension's config include:

```
include('vendor/neam/yii-dna-debug-modes-and-error-handling/config/error-handling.php');

```

This will configure the error handler and ensure that your Yii::app() uses the included trait (necessary for proper error handling).

To use a custom class for Yii::app(), adjust your frontend entry script from the default:

```
Yii::createWebApplication($config)->run();

```

To something that looks like this:

```
require_once("$approot/vendor/neam/yii-dna-debug-modes-and-error-handling/components/YiiDnaWebApplication.php");
Yii::createApplication('YiiDnaWebApplication', $config)->run();

```

If you already have your own custom class, make sure that it uses the included YiiDnaWebApplicationTrait.

To use the SaveException, make a habit of throwing it whenever $model-&gt;save() returns false, like so:

```
if (!$model->save()) {
    throw new SaveException($model);
}

```

The exception message will contain useful information about validation errors, making it easy to spot what went wrong.

### Debug Modes

[](#debug-modes-1)

In your main configuration file, make sure that the current configuration is available in a variable called `$config`, then include this extension's config include:

```
include('vendor/neam/yii-dna-debug-modes-and-error-handling/config/debug-modes.php');

```

This will make the debug modes available.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d71e1dd8ef0c10991227f77fbc40e68504121455a0ec42e3ae7d05630f47605c?d=identicon)[motin](/maintainers/motin)

---

Top Contributors

[![motin](https://avatars.githubusercontent.com/u/793037?v=4)](https://github.com/motin "motin (14 commits)")

### Embed Badge

![Health badge](/badges/neam-yii-dna-debug-modes-and-error-handling/health.svg)

```
[![Health](https://phpackages.com/badges/neam-yii-dna-debug-modes-and-error-handling/health.svg)](https://phpackages.com/packages/neam-yii-dna-debug-modes-and-error-handling)
```

###  Alternatives

[symfony/stopwatch

Provides a way to profile code

2.8k387.2M918](/packages/symfony-stopwatch)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/packages/fruitcake-laravel-debugbar)[spatie/ignition

A beautiful error page for PHP applications.

510147.6M69](/packages/spatie-ignition)[jokkedk/webgrind

Webgrind is a Xdebug profiling web frontend in PHP5. It implements a subset of the features of kcachegrind and installs in seconds and works on all platforms. For quick'n'dirty optimizations it does the job.

3.3k193.0k](/packages/jokkedk-webgrind)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[soloterm/dumps

A Laravel command to intercept dumps from your Laravel application.

125285.7k3](/packages/soloterm-dumps)

PHPackages © 2026

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