Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/irontec/json-exception-response-bundle
Treat exceptions in JSON
https://github.com/irontec/json-exception-response-bundle
bundle json-exception symfony
Last synced: 9 days ago
JSON representation
Treat exceptions in JSON
- Host: GitHub
- URL: https://github.com/irontec/json-exception-response-bundle
- Owner: irontec
- License: eupl-1.1
- Created: 2019-07-04T11:41:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-15T09:31:00.000Z (9 months ago)
- Last Synced: 2024-09-18T12:44:30.904Z (about 2 months ago)
- Topics: bundle, json-exception, symfony
- Language: PHP
- Size: 11.7 KB
- Stars: 2
- Watchers: 16
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Json Exception Response
Captura las Exception que se generen y las formatea antes de generar el Response JSON.
````bash
composer require irontec/json-exception-response-bundle
````Si el proyecto esta en modo **dev** se devuelve un parametro "debug" con una pequeña traza de donde se genero la excepción.
````json
{
"error": {
"code": 400,
"message": "Error message!",
"debug": {
"file": "/opt/symfony/vendor/symfony/http-kernel/HttpKernel.php",
"line": 151,
"function": "index",
"class": "App\\Controller\\ExampleController",
"type": "->",
"args": [
{}
]
}
}
}
````