Skip to content

Commit 2ca50e9

Browse files
author
Vincent Chalnot
committed
Tagging encryption exceptions with the same interface for easier debugging
1 parent e412a95 commit 2ca50e9

8 files changed

+26
-8
lines changed

Exception/BadNonceException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
*
1616
* @author Vincent Chalnot <[email protected]>
1717
*/
18-
class BadNonceException extends \RuntimeException
18+
class BadNonceException extends \RuntimeException implements EncryptionExceptionInterface
1919
{
2020
}

Exception/EmptyCipherKeyException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
*
1616
* @author Vincent Chalnot <[email protected]>
1717
*/
18-
class EmptyCipherKeyException extends \RuntimeException
18+
class EmptyCipherKeyException extends \RuntimeException implements EncryptionExceptionInterface
1919
{
2020
}

Exception/EmptyOwnershipIdException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
*
1616
* @author Vincent Chalnot <[email protected]>
1717
*/
18-
class EmptyOwnershipIdException extends \RuntimeException
18+
class EmptyOwnershipIdException extends \RuntimeException implements EncryptionExceptionInterface
1919
{
2020
}

Exception/EncryptionException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
*
1616
* @author Vincent Chalnot <[email protected]>
1717
*/
18-
class EncryptionException extends \RuntimeException
18+
class EncryptionException extends \RuntimeException implements EncryptionExceptionInterface
1919
{
2020
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/*
3+
* This file is part of the Sidus/EncryptionBundle package.
4+
*
5+
* Copyright (c) 2015-2018 Vincent Chalnot
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
11+
namespace Sidus\EncryptionBundle\Exception;
12+
13+
/**
14+
* All dedicated exceptions are tagged with this interface
15+
*/
16+
interface EncryptionExceptionInterface
17+
{
18+
}

Exception/EndOfStreamException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
namespace Sidus\EncryptionBundle\Exception;
1212

1313
/**
14-
* Can occure when the encrypted data end unexpectedly
14+
* Can occurs when the encrypted data end unexpectedly
1515
*
1616
* @author Vincent Chalnot <[email protected]>
1717
*/
18-
class EndOfStreamException extends \RuntimeException
18+
class EndOfStreamException extends \RuntimeException implements EncryptionExceptionInterface
1919
{
2020
}

Exception/FileHandlingException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
*
1616
* @author Vincent Chalnot <[email protected]>
1717
*/
18-
class FileHandlingException extends \RuntimeException
18+
class FileHandlingException extends \RuntimeException implements EncryptionExceptionInterface
1919
{
2020
}

Exception/RandomGeneratorException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
*
1616
* @author Vincent Chalnot <[email protected]>
1717
*/
18-
class RandomGeneratorException extends \RuntimeException
18+
class RandomGeneratorException extends \RuntimeException implements EncryptionExceptionInterface
1919
{
2020
}

0 commit comments

Comments
 (0)