dkd-dobberkau/enhanced-error-handler 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dkd-dobberkau/enhanced-error-handler

Composer 安装命令:

composer require dkd-dobberkau/enhanced-error-handler

包简介

Enhanced TYPO3 Debug Exception Handler with copy-to-clipboard functionality similar to Laravel Ignition

README 文档

README

TYPO3 License Packagist

A debug exception handler for TYPO3 with copy-to-clipboard functionality, using TYPO3's standard styling.

Features

  • Copy-to-Clipboard Buttons: Quickly copy exception messages, stack traces, code snippets, and file paths
  • TYPO3 Standard UI: Matches the familiar TYPO3 backend look and feel
  • Collapsible Stack Frames: Click on any frame to expand/collapse code context
  • Vendor Frame Highlighting: Application code is visually distinct from vendor/framework code
  • Code Snippets: See the relevant code around each error location
  • Keyboard Shortcuts: Press Ctrl+Shift+C (or Cmd+Shift+C on Mac) to copy all exception details
  • Markdown Output: Copy All generates Markdown-formatted output for easy pasting into issues
  • Toast Notifications: Visual feedback when content is copied

Requirements

  • TYPO3 12.4 LTS or 13.4+
  • PHP 8.1+

Installation

Via Composer

composer require dkd-dobberkau/enhanced-error-handler

Manual Installation

  1. Clone or download from GitHub
  2. Extract to packages/enhanced_error_handler/ or typo3conf/ext/enhanced_error_handler/
  3. Add path repository to your composer.json:
{
    "repositories": [
        {
            "type": "path",
            "url": "packages/*"
        }
    ]
}
  1. Then require the package:
composer require dkd-dobberkau/enhanced-error-handler:@dev

Configuration

Add the following to your config/system/additional.php:

<?php

// Register the enhanced debug exception handler
$GLOBALS['TYPO3_CONF_VARS']['SYS']['debugExceptionHandler'] =
    \Dkd\EnhancedErrorHandler\Error\EnhancedDebugExceptionHandler::class;

Recommended Development Settings

<?php

// Enable error display
$GLOBALS['TYPO3_CONF_VARS']['SYS']['displayErrors'] = 1;

// Allow all IPs to see debug output (development only!)
$GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'] = '*';

// Use enhanced handler
$GLOBALS['TYPO3_CONF_VARS']['SYS']['debugExceptionHandler'] =
    \Dkd\EnhancedErrorHandler\Error\EnhancedDebugExceptionHandler::class;

// Convert more error types to exceptions for better debugging
$GLOBALS['TYPO3_CONF_VARS']['SYS']['exceptionalErrors'] =
    E_ALL ^ E_NOTICE ^ E_WARNING ^ E_USER_ERROR ^ E_USER_NOTICE ^ E_USER_WARNING;

Usage

Copy Buttons

Each section of the error page has a copy button:

  • Copy All: Copies the complete exception details in Markdown format
  • Message: Copies just the exception message
  • Location: Copies the file path and line number
  • Code Snippet: Copies the code around the error
  • Stack Trace: Copies the formatted stack trace

Keyboard Shortcuts

Shortcut Action
Ctrl+Shift+C / Cmd+Shift+C Copy all exception details

Stack Trace Navigation

  • Click on any stack frame to expand/collapse it
  • Expanded frames show the full file path and code context
  • Vendor/framework frames are slightly dimmed for easier navigation
  • The first frame is expanded by default

Security Warning

⚠️ Never use this handler in production!

This extension displays detailed error information including:

  • Full file paths
  • Code snippets
  • Stack traces with arguments
  • Server environment details

Always ensure displayErrors is set to 0 in production, and that devIPmask is properly configured.

Customization

Extending the Handler

You can extend the handler to add custom functionality:

<?php

namespace MyVendor\MyExtension\Error;

use Dkd\EnhancedErrorHandler\Error\EnhancedDebugExceptionHandler;

class MyCustomExceptionHandler extends EnhancedDebugExceptionHandler
{
    protected function getHeader(): string
    {
        return '<div class="header">
            <img src="/path/to/your/logo.svg" alt="Logo">
            <h1>Something went wrong</h1>
        </div>';
    }
}

Custom Styling

Override the getEnhancedStylesheet() method to customize colors:

protected function getEnhancedStylesheet(): string
{
    $css = parent::getEnhancedStylesheet();

    $css .= '
        :root {
            --accent-orange: #your-brand-color;
        }
    ';

    return $css;
}

Changelog

1.0.0

  • Initial release
  • Copy-to-clipboard functionality
  • TYPO3 standard styling
  • Collapsible stack frames
  • Code snippets with line highlighting
  • Keyboard shortcuts
  • Toast notifications
  • Markdown-formatted copy output

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

GPL-2.0-or-later

Credits

dkd-dobberkau/enhanced-error-handler 适用场景与选型建议

dkd-dobberkau/enhanced-error-handler 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 31 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 dkd-dobberkau/enhanced-error-handler 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 dkd-dobberkau/enhanced-error-handler 我们能提供哪些服务?
定制开发 / 二次开发

基于 dkd-dobberkau/enhanced-error-handler 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 24
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2026-01-31