承接 spencer-mortensen/exceptions 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

spencer-mortensen/exceptions

最新稳定版本:6.0.3

Composer 安装命令:

composer require spencer-mortensen/exceptions

包简介

Catch fatal errors and warnings that would otherwise be difficult to handle

关键字:

README 文档

README

This project is available as a Composer Package:
spencer-mortensen/exceptions

Overview

Error handling in PHP is complicated, but this library makes it bullet-proof: Create a method to handle exceptions (e.g. $handler->handle($throwable);) and you're good to go!

This library converts all PHP notices, warnings, and errors into exceptions, so you can handle them. It also works on any thrown exceptions that make it up to the global scope. It even catches most of the fatal errors, which would otherwise be impossible to handle.

Usage

Example 1. Enable error handling for the entire program:

new ErrorHandling($errorHandler, E_ALL);

Example 2. Enable error handling ONLY for your portion of the code:

try { ErrorHandling::on(); ... } finally { ErrorHandling::off(); }

This converts PHP notices, warnings, and errors into catchable exceptions, but only for the duration of the try/catch block.

Example 3. Show the built-in PHP STDERR messages, so you can see errors while you're working on your error handler. If you're working on your error handler, and you're getting a blank screen, use this:

new ErrorHandling($errorHandler, E_ALL, false);

When you're finished, set everything back to normal:

new ErrorHandling($errorHandler, E_ALL);

See the example area for working code and ideas.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固