proklung/api-exception-bundle

Бандл для управления исключениями, выбрасываемыми API

Installs: 19

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Type:symfony-bundle

1.0.1 2021-08-08 17:55 UTC

This package is auto-updated.

Last update: 2024-11-09 00:47:57 UTC


README

Форк https://github.com/M6Web/ApiExceptionBundle, причесанный под частные нужды.

INTERNAL

Установка

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"