itamit/classifier-error-bundle

symfony分类错误组件包

dev-develop 2020-06-04 06:51 UTC

This package is auto-updated.

Last update: 2024-09-04 16:34:52 UTC


README

从异常自动生成错误

分类器表示应用程序异常监听器。为了将异常转换为HTTP响应,请在异常的code字段中指定分类器已知错误代码。

状态

此包目前正在积极开发中。

要求

安装

  1. 使用Composer要求组件和一个PSR 7/17实现

    composer require itamit/classifier-error-bundle
  2. config/bundles.php中启用组件,通过将其添加到数组中

    Itamit\ClassifierErrorBundle\ClassifierErrorBundle::class => ['all' => true]

添加自定义分类错误

  1. 创建一个实现接口Itamit\ClassifierErrorBundle\Provider\ErrorProviderInterface的类

  2. 将创建的类作为服务注册,标签为classifier_error.error_provider