PHPackages                             zolfa/readable-api-error-response-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. zolfa/readable-api-error-response-bundle

ActiveLibrary[API Development](/categories/api)

zolfa/readable-api-error-response-bundle
========================================

01201PHP

Since Jun 20Pushed 9y ago1 watchersCompare

[ Source](https://github.com/zolfa/ReadableApiErrorResponseBundle)[ Packagist](https://packagist.org/packages/zolfa/readable-api-error-response-bundle)[ RSS](/packages/zolfa-readable-api-error-response-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

This bundle is usually used in conjunction with the [FOSRestBundle](https://github.com/FriendsOfSymfony/FOSRestBundle) for returning readable exception messages.

By default, when a controller throws an exception, a response is returned with a status code of 500 and the content set to `"internal error`". The problem, however, is that exceptions you throw which contain helpful information are lost.

This means you have no way of providing useful error messages to developers who are going to use your API, and your UI application has no way of providing helpful messages to end users.

This bundle makes that as easy as a simple `composer install` and registration of the bundle in your `AppKernel`.

Installation
============

[](#installation)

Step 1: Download the Bundle
---------------------------

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
$ composer require azolf/readable-api-response-bundle
```

This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

Step 2: Enable the Bundle
-------------------------

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in the `app/AppKernel.php` file of your project:

```
