proklung / api-exception-bundle
用于管理API抛出的异常的包
1.0.1
2021-08-08 17:55 UTC
Requires
- php: >=7.3 || ^8.0
- symfony/config: ^4.4 || ^5.0
- symfony/dependency-injection: ^4.4 || ^5.0
- symfony/http-kernel: ^4.4 || ^5.0
This package is auto-updated.
Last update: 2024-09-09 00:28:21 UTC
README
内部 https://github.com/M6Web/ApiExceptionBundle,经过调整以适应特定需求。
内部
安装
composer require proklung/api-exception-bundle
任何
示例配置文件 (/local/config/packages/m6web_api_exception.yaml)
m6web_api_exception: match_all: false exceptions: Prokl\ApiExceptionBundle\ExampleExceptions\DemoApiBundleException: status: 405 # Used for exceptions implements HttpExceptionInterface # code: 5286 # Create an unique code for this exception in your API, optional, default to 0 and not displayed message: "Example exception" Prokl\\ApiExceptionBundle\ExampleExceptions\DemoApiBundleVariableException: status: 406 # Used for exceptions implements HttpExceptionInterface # code: 5286 # Create an unique code for this exception in your API, optional, default to 0 and not displayed message: "Example exception with variable {id}" Prokl\\ApiExceptionBundle\ExampleExceptions\DemoUnknownException: status: 406 # Used for exceptions implements HttpExceptionInterface # code: 5286 # Create an unique code for this exception in your API, optional, default to 0 and not displayed message: "Example exception with errors"