PabloKowalczyk/SupercacheBundle

View on GitHub
src/Exceptions/SecurityViolationException.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php

declare(strict_types=1);

namespace PabloK\SupercacheBundle\Exceptions;

/**
 * Thrown on serious security-related events - you should NEVER ignore that exception!
 */
class SecurityViolationException extends \RuntimeException
{
    public function __construct(
        string $message = '',
        int $code = 0,
        \Exception $previous = null
    ) {
        $newMessage = 'Security violation occurred, operation was aborted.';

        if (!empty($message)) {
            $newMessage .= ' ' . $message;
        }

        parent::__construct($newMessage, $code, $previous);
    }
}