Search by

spiral-packages / yii-error-handler-bridge

butschster

Yii Error Handler integration package for Spiral Framework

Package info

github.com/spiral-packages/yii-error-handler-bridge

pkg:composer/spiral-packages/yii-error-handler-bridge

Fund package maintenance!

spiral

Statistics

Installs: 141 453

Dependents: 1

Suggesters: 0

Stars: 2

Open Issues: 0

1.2.0 2026-11-08 10:32 UTC

This package is auto-updated.

Last update: 2026-11-08 12:09:24 UTC


README

Spiral Framework

Yii error renderers for Spiral Framework

Documentation Sponsor

Psalm Level Type Coverage Codecov Mutation testing badge


This package plugs the yiisoft/error-handler renderers into the Spiral exception handler, so exceptions are rendered as HTML, JSON, XML or plain text depending on the requested format and verbosity level.

Get Started

Installation

composer require spiral-packages/yii-error-handler-bridge

PHP Latest Version on Packagist License Total Downloads

Requirements: PHP 8.2+ and Spiral Framework 3.15+.

Configuration

Register the bootloader in your application kernel:

public function defineBootloaders(): array
{
    return [
        // ...
        \Spiral\YiiErrorHandler\Bootloader\YiiErrorHandlerBootloader::class,
        // ...
    ];
}

See the documentation for details on renderers and verbosity levels.

Acceptance Test Sandbox

This package includes an acceptance test sandbox that demonstrates how the different error renderers work with various verbosity levels. The sandbox provides a simple web interface to visualize errors rendered in HTML, JSON, XML, and Plain Text formats.

Running the Sandbox

You can run the sandbox using Composer:

composer sandbox

Or manually start the PHP built-in web server from the project root:

php -S localhost:8000 tests/Acceptance/server.php

Then open your browser and navigate to http://localhost:8000

The interface allows you to select different renderer types (HTML, JSON, Plain Text, XML) and verbosity levels (Basic, Verbose, Debug) to see how exceptions are presented in each format.

This sandbox is useful for testing and understanding how the error renderers work in different scenarios without needing to integrate them into a full application.