Simple base exception class

v1.1.2 2020-02-04 16:05 UTC

This package is auto-updated.

Last update: 2020-11-04 17:49:05 UTC


Simple base exception class providing public and private context inspired by https://github.com/EasyCorp/EasyAdminBundle

Installation and usage

Installation with composer

composer require holicz/simple-exception

Your exception class:


namespace App\Exception;

use holicz\SimpleException\BaseException;
use holicz\SimpleException\ExceptionContext;

class MyException extends BaseException
    public function __construct(array $parameters = [])
        $exceptionContext = new ExceptionContext(
            'My public message',
            sprintf('My private message with params: %s', $parameters['key']),
            500 // HTTP status code

Your code

try {
} catch (MyException $e) {
    // Available methods