-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
53 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
/** | ||
* Nucleus - XMPP Library for PHP | ||
* | ||
* Copyright (C) 2016, Some rights reserved. | ||
* | ||
* @author Kacper "Kadet" Donat <[email protected]> | ||
* | ||
* Contact with author: | ||
* Xmpp: [email protected] | ||
* E-mail: [email protected] | ||
* | ||
* From Kadet with love. | ||
*/ | ||
|
||
namespace Kadet\Xmpp\Exception\Protocol; | ||
|
||
|
||
use Exception; | ||
use Kadet\Xmpp\Exception\PropertyAccessException; | ||
use Kadet\Xmpp\Stanza\Error; | ||
|
||
class StanzaException extends PropertyAccessException | ||
{ | ||
/** @var Error */ | ||
private $_error; | ||
|
||
/** | ||
* Construct the exception. Note: The message is NOT binary safe. | ||
* @link http://php.net/manual/en/exception.construct.php | ||
* @param Error $error Stanza error describing exception | ||
* @param string $message [optional] The Exception message to throw. | ||
* @param int $code [optional] The Exception code. | ||
* @param Exception $previous [optional] The previous exception used for the exception chaining. Since 5.3.0 | ||
* @since 5.1.0 | ||
*/ | ||
public function __construct(Error $error, $message = '', $code = 0, Exception $previous = null) | ||
{ | ||
parent::__construct($message, $code, $previous); | ||
$this->_error = $error; | ||
} | ||
|
||
|
||
/** | ||
* @return Error | ||
*/ | ||
public function getError() : Error | ||
{ | ||
return $this->_error; | ||
} | ||
} |