1: <?php
2: /**
3: * Maniaplanet Web Services SDK for PHP
4: *
5: * @see http://code.google.com/p/maniaplanet-ws-sdk/
6: * @copyright Copyright (c) 2009-2011 NADEO (http://www.nadeo.com)
7: * @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
8: * @author $Author: baptiste33@gmail.com $:
9: * @version $Revision: 113 $:
10: * @date $Date: 2012-07-11 14:56:37 +0200 (mer., 11 juil. 2012) $:
11: */
12:
13: namespace Maniaplanet\WebServices;
14:
15: /**
16: * Exception thrown by the services when something goes wrong
17: */
18: class Exception extends \Exception
19: {
20:
21: protected $HTTPStatusCode;
22: protected $HTTPStatusMessage;
23:
24: function __construct($message='', $code=0, $HTTPStatusCode=0,
25: $HTTPStatusMessage='')
26: {
27: parent::__construct($message ? : $HTTPStatusMessage, $code ? : $HTTPStatusCode);
28:
29: $this->HTTPStatusCode = $HTTPStatusCode;
30: $this->HTTPStatusMessage = $HTTPStatusMessage;
31: }
32:
33: /**
34: * The HTTP status code returned in case of an error, eg. 404
35: * @return int
36: */
37: function getHTTPStatusCode()
38: {
39: return $this->HTTPStatusCode;
40: }
41:
42: /**
43: * The HTTP status message returned in case of an error, eg. "Not Found"
44: * @return string
45: */
46: function getHTTPStatusMessage()
47: {
48: return $this->HTTPStatusMessage;
49: }
50:
51: }
52:
53: ?>