yolo/errors
最新稳定版本:v1.0.3
Composer 安装命令:
composer require yolo/errors
包简介
A package for yolo errors
README 文档
README
An error handling package for the yolo microservices framework.
Usage
Register error module and types.
$registry = \Yolo\Errors\ExceptionRegistry::inst(); $registry->createExceptionRegistry( 'user.service.com', [ 'user' => [ 'index' => Number::createIncreaseCodeIndex(1000000) ] ] );Register an error
$registry->register( (new \Yolo\Errors\ResponseError('user', 'user_not_found', 'User not found.'))->setHttpStatus(404) );Throw a new error
throw \Yolo\Service\ApiGateway::responseError('user_not_found', [ 'userId' => 123, ]);
It will throw a YoloException, which will be caught and handled by the framework and returned.
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-05-08