idiosyncratic/http-exceptions
Composer 安装命令:
composer require idiosyncratic/http-exceptions
包简介
Exceptions for PSR HTTP Server Requests
README 文档
README
Introduction
A library providing Exception classes for HTTP Requests. HTTP Exceptions require the server request instance to facilitate advanced exception handlers to generate appropriate responses (for example, sending the correct content type in the response).
Installation
Use Composer:
composer require idiosyncratic/http-exceptions
Usage
use Idiosyncratic\Http\Exception\Server\InternalServerError; // $request must be an instance of Psr\Http\Message\ServerRequestInterface; throw new InternalServerError($request);
You may also wrap a previous exception, just as with a regular Exception:
use Idiosyncratic\Http\Exception\Server\InternalServerError; try { throw new \Exception('Something went wrong'); } catch (\Throwable $throwable) { // $request must be an instance of Psr\Http\Message\ServerRequestInterface; throw new InternalServerError($request, $throwable); }
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: ISC
- 更新时间: 2019-11-28