File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 3
3
namespace MattJanssen \ApiResponseBundle \Exception ;
4
4
5
5
use Symfony \Component \HttpFoundation \Response ;
6
+ use Symfony \Component \HttpKernel \Exception \HttpExceptionInterface ;
6
7
7
8
/**
8
9
* Exception for a Failed API Response
13
14
*
14
15
* @author Matt Janssen <matt@mattjanssen.com>
15
16
*/
16
- class ApiResponseException extends \Exception implements ApiResponseExceptionInterface
17
+ class ApiResponseException extends \Exception implements HttpExceptionInterface, ApiResponseExceptionInterface
17
18
{
18
19
/**
19
20
* HTTP Response Status Code
@@ -93,4 +94,24 @@ public function setErrorData($errorData)
93
94
{
94
95
$ this ->errorData = $ errorData ;
95
96
}
97
+
98
+ /**
99
+ * Returns the status code.
100
+ *
101
+ * @return int An HTTP response status code
102
+ */
103
+ public function getStatusCode ()
104
+ {
105
+ return $ this ->getHttpStatusCode ();
106
+ }
107
+
108
+ /**
109
+ * Returns response headers.
110
+ *
111
+ * @return array Response headers
112
+ */
113
+ public function getHeaders ()
114
+ {
115
+ return [];
116
+ }
96
117
}
You can’t perform that action at this time.
0 commit comments