php-platform/errors
Composer 安装命令:
composer require php-platform/errors
包简介
README 文档
README
This package provides uniform APIs for Error handling and logging
Introduction
This Package mainly solves 3 problems
- Provides Exception types for all purposes, well categorized and with unique codes
- Common way to log all Exceptions and Errors
- Handles PHP System Errors and converts them into Exceptions
Exception Types
Following Exception types are available for Application developers to use.
-
PlatformException
abstractParent of all exceptions , derived from Exception, all logging mechanism implemented here-
PersistenceException
abstractParent of all persistant exceptions, these exceptions to be used by Persistant layer- BadQueryException
- DataNotFoundException
- NoAccessException
- NoConnectionException
- NoDuplicateException
- ReferenceIntegrityViolationException
-
ApplicationException
abstractParent of all application exceptions, these exceptions to be used by Application/Business Layer- BadInputException
- Debug
- NoAccessException
- ProgrammingError
-
HttpException
abstractParent of all Http exceptions, these exceptions to be used by View or Web Service Layers- _1XX All exceptions for Informational Http Codes
- _2XX All exceptions for Success Http codes
- _3XX All exceptions for Redirectional Http codes
- _4XX All exceptions for Client Error Http codes
- _5XX All exceptions for Server Error Http codes
-
SystemException
abstractParent of all System Exceptions generated from handling PHP System Errors- SystemError For all Errors this Exception is created and thrown from ErrorHandler
- SystemWarning For all Warnings, This exception is not thrown by the ErrorHandler , instead this is created for the purpose of logging
-
Configuration
Configurations available for this Package
This Configuration is based on PHPPlatform/config
{ "logs":{ // log file paths for each category of exceptions "Persistence":null, "Application":null, "Http":null, "System":null }, "traces":{ // trace file paths for each category of exceptions "Persistence":null, "Application":null, "Http":null, "System":null } }
To enable Error Handling , call error handling function as below
PhpPlatform\Errors\ErrorHandler::handleError();
统计信息
- 总下载量: 2.6k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 7
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2016-12-28