-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use distinguishable exception classes.
- Loading branch information
Showing
7 changed files
with
202 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
framework/ManageSieve/lib/Horde/ManageSieve/Exception/ConnectionFailed.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* Copyright 2015 Horde LLC (http://www.horde.org/) | ||
* | ||
* See the enclosed file LICENSE for license information (BSD). If you | ||
* did not receive this file, see http://www.horde.org/licenses/bsd. | ||
* | ||
* @author Jan Schneider <jan@horde.org> | ||
* @category Horde | ||
* @license http://www.horde.org/licenses/bsd BSD | ||
* @package ManageSieve | ||
*/ | ||
|
||
namespace Horde\ManageSieve\Exception; | ||
use Horde\ManageSieve | ||
|
||
/** | ||
* Exception thrown if connecting to the server failed. | ||
* | ||
* @author Jan Schneider <jan@horde.org> | ||
* @category Horde | ||
* @copyright 2015 Horde LLC | ||
* @license http://www.horde.org/licenses/bsd BSD | ||
* @package ManageSieve | ||
*/ | ||
class ConnectionFailed extends Exception | ||
{ | ||
/** | ||
* Exception constructor. | ||
* | ||
* @param Exception $message An Exception object. | ||
*/ | ||
public function __construct(Exception $e) | ||
{ | ||
parent::__construct('Failed to connect, server said: ' . $e->getMessage()); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
framework/ManageSieve/lib/Horde/ManageSieve/Exception/NotAuthenticated.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* Copyright 2015 Horde LLC (http://www.horde.org/) | ||
* | ||
* See the enclosed file LICENSE for license information (BSD). If you | ||
* did not receive this file, see http://www.horde.org/licenses/bsd. | ||
* | ||
* @author Jan Schneider <jan@horde.org> | ||
* @category Horde | ||
* @license http://www.horde.org/licenses/bsd BSD | ||
* @package ManageSieve | ||
*/ | ||
|
||
namespace Horde\ManageSieve\Exception; | ||
use Horde\ManageSieve | ||
|
||
/** | ||
* Exception thrown if the user should be authenticated but isn't. | ||
* | ||
* @author Jan Schneider <jan@horde.org> | ||
* @category Horde | ||
* @copyright 2015 Horde LLC | ||
* @license http://www.horde.org/licenses/bsd BSD | ||
* @package ManageSieve | ||
*/ | ||
class NotAuthenticated extends Exception | ||
{ | ||
/** | ||
* Exception constructor. | ||
* | ||
* @param mixed $message The exception message, or an Exception object. | ||
*/ | ||
public function __construct($message = 'Not currently in AUTHENTICATED state') | ||
{ | ||
parent::__construct($message); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
framework/ManageSieve/lib/Horde/ManageSieve/Exception/NotConnected.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* Copyright 2015 Horde LLC (http://www.horde.org/) | ||
* | ||
* See the enclosed file LICENSE for license information (BSD). If you | ||
* did not receive this file, see http://www.horde.org/licenses/bsd. | ||
* | ||
* @author Jan Schneider <jan@horde.org> | ||
* @category Horde | ||
* @license http://www.horde.org/licenses/bsd BSD | ||
* @package ManageSieve | ||
*/ | ||
|
||
namespace Horde\ManageSieve\Exception; | ||
use Horde\ManageSieve | ||
|
||
/** | ||
* Exception thrown if the server should be connected but isn't. | ||
* | ||
* @author Jan Schneider <jan@horde.org> | ||
* @category Horde | ||
* @copyright 2015 Horde LLC | ||
* @license http://www.horde.org/licenses/bsd BSD | ||
* @package ManageSieve | ||
*/ | ||
class NotConnected extends Exception | ||
{ | ||
/** | ||
* Exception constructor. | ||
* | ||
* @param mixed $message The exception message, or an Exception object. | ||
*/ | ||
public function __construct($message = 'Not currently connected') | ||
{ | ||
parent::__construct($message); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
framework/ManageSieve/lib/Horde/ManageSieve/Exception/NotDisconnected.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* Copyright 2015 Horde LLC (http://www.horde.org/) | ||
* | ||
* See the enclosed file LICENSE for license information (BSD). If you | ||
* did not receive this file, see http://www.horde.org/licenses/bsd. | ||
* | ||
* @author Jan Schneider <jan@horde.org> | ||
* @category Horde | ||
* @license http://www.horde.org/licenses/bsd BSD | ||
* @package ManageSieve | ||
*/ | ||
|
||
namespace Horde\ManageSieve\Exception; | ||
use Horde\ManageSieve | ||
|
||
/** | ||
* Exception thrown if the server should be disconnected but isn't. | ||
* | ||
* @author Jan Schneider <jan@horde.org> | ||
* @category Horde | ||
* @copyright 2015 Horde LLC | ||
* @license http://www.horde.org/licenses/bsd BSD | ||
* @package ManageSieve | ||
*/ | ||
class NotDisconnected extends Exception | ||
{ | ||
/** | ||
* Exception constructor. | ||
* | ||
* @param mixed $message The exception message, or an Exception object. | ||
*/ | ||
public function __construct($message = 'Not currently in DISCONNECTED state') | ||
{ | ||
parent::__construct($message); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
framework/ManageSieve/lib/Horde/ManageSieve/Exception/Referral.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* Copyright 2015 Horde LLC (http://www.horde.org/) | ||
* | ||
* See the enclosed file LICENSE for license information (BSD). If you | ||
* did not receive this file, see http://www.horde.org/licenses/bsd. | ||
* | ||
* @author Jan Schneider <jan@horde.org> | ||
* @category Horde | ||
* @license http://www.horde.org/licenses/bsd BSD | ||
* @package ManageSieve | ||
*/ | ||
|
||
namespace Horde\ManageSieve\Exception; | ||
use Horde\ManageSieve | ||
|
||
/** | ||
* Exception thrown if the referring to a different server failed. | ||
* | ||
* @author Jan Schneider <jan@horde.org> | ||
* @category Horde | ||
* @copyright 2015 Horde LLC | ||
* @license http://www.horde.org/licenses/bsd BSD | ||
* @package ManageSieve | ||
*/ | ||
class Referral extends Exception | ||
{ | ||
} |