Download the PHP package tounaf/exception-bundle without Composer

On this page you can find all versions of the php package tounaf/exception-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package exception-bundle

If you need to manage complexe exception in your application, this bundle is set for you . This bundle provides interface to facilitate the customization of the exception rendering in Symfony project. Each exception that you create has his own handler classe. Your exception will be scalable, maintenable, independent.

1 - Installation

2 - How to work

By default, this bundle handle exception and render a json response but you can customize this behavior with your needs (ex: html)

3 - Create custom execption handler

Create an class and implement the PulseExceptionInteface interface. It contains two methods:

** handleException: This method have Throwble as argument and returns a Symfony Response

** supportsException: This method have Throwble as argument and return boolean.

Example:

First create Exception to handle through the app.

Then create the handler that handle this exception

When MyException is thrown, the MyExceptionHandler class is called by the system . For example:

3 - Format Response

Sometimes, your app provides the service that third party can consume: for example :

but the uri

An HandlerException can provide multiple format of response like html, json, etc.
By default, this bundle supports html and json for format of response but it is extensible to create custom format like json-ld, xml etc.
To do that, you need to implement the interface Tounaf\ExceptionBundle\FormatResponse\FormatResponseCheckerInterface.
This interface have a method setFormat(FormatResponseInterface $formatResponse) that accepts FormatResponseInterface as argument.

What happen with this code ? As said at the top, this bundle provides two responses by default : html and json. Which of these formats on this code ? For the URI that match /api/, the response used is json else html is rendered.


All versions of exception-bundle with dependencies

PHP Build Version
Package Version
Requires symfony/dependency-injection Version 6.4.* || 6.3.* || 6.2.* || 6.1.* || 5.4.* || 4.4.*
symfony/config Version 6.4.* || 6.3.* || 6.2.* || 6.1.* || 5.4.* || 4.4.*
symfony/framework-bundle Version 6.4.* || 6.3.* || 6.2.* || 6.1.* || 5.4.* || 4.4.*
symfony/http-kernel Version 6.4.* || 6.3.* || 6.2.* || 6.1.* || 5.4.* || 4.4.*
tounaf/exception-handler Version ^1.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tounaf/exception-bundle contains the following files

Loading the files please wait ....