Skip to content

Commit 2420aa5

Browse files
committed
Exception constructor should save error message and code
1 parent eac942d commit 2420aa5

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

lib/Sp_CurlException.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
<?php
2+
/**
3+
* CURL ShootProof PHP SDK exception.
4+
*
5+
* To find more information and for documentation of the API please
6+
* visit http://developer.shootproof.com
7+
*/
8+
class Sp_CurlException extends Sp_Exception
9+
{
210

3-
class Sp_CurlException extends Sp_Exception {}
11+
}

lib/Sp_Exception.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
/**
43
* Base ShootProof PHP SDK exception.
54
*
@@ -26,6 +25,7 @@ class Sp_Exception extends Exception
2625
*/
2726
public function __construct($msg, $code = 0, $responseBody = null)
2827
{
28+
parent::__construct($msg, $code);
2929
$this->_responseBody = $responseBody;
3030
}
3131

lib/Sp_NoResponseException.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
<?php
2+
/**
3+
* Empty response ShootProof PHP SDK exception.
4+
*
5+
* To find more information and for documentation of the API please
6+
* visit http://developer.shootproof.com
7+
*/
8+
class Sp_NoResponseException extends Sp_Exception
9+
{
210

3-
class Sp_NoResponseException extends Sp_Exception {}
11+
}

0 commit comments

Comments
 (0)