Skip to content

Commit 51904d2

Browse files
feat: Base classes for server and client http exceptions.
Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>
1 parent 60189b6 commit 51904d2

22 files changed

+48
-41
lines changed

src/Http/Client/HttpBadRequestException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
77
namespace Jitesoft\Exceptions\Http\Client;
88

9-
use Jitesoft\Exceptions\Http\HttpException;
109
use Throwable;
1110

1211
/**
1312
* Class HttpBadRequestException
1413
*
1514
* Client http exception thrown for bad request errors.
1615
*/
17-
class HttpBadRequestException extends HttpException {
16+
class HttpBadRequestException extends HttpClientException {
1817

1918
/**
2019
* HttpBadRequestException constructor.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
3+
HttpClientException.php - Part of the php-exceptions project.
4+
5+
© - Jitesoft
6+
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
7+
namespace Jitesoft\Exceptions\Http\Client;
8+
9+
use Jitesoft\Exceptions\Http\HttpException;
10+
11+
/**
12+
* Base class for HTTP Client Exceptions.
13+
*/
14+
abstract class HttpClientException extends HttpException {}

src/Http/Client/HttpConflictException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
43
HttpConflictException.php - Part of the php-exceptions project.
54
@@ -8,15 +7,14 @@
87

98
namespace Jitesoft\Exceptions\Http\Client;
109

11-
use Jitesoft\Exceptions\Http\HttpException;
1210
use Throwable;
1311

1412
/**
1513
* Class HttpConflictException
1614
*
1715
* Client http exception thrown on http conflict errors.
1816
*/
19-
class HttpConflictException extends HttpException {
17+
class HttpConflictException extends HttpClientException {
2018

2119
/**
2220
* HttpConflictException constructor.

src/Http/Client/HttpExpectationFailedException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
77
namespace Jitesoft\Exceptions\Http\Client;
88

9-
use Jitesoft\Exceptions\Http\HttpException;
109
use Throwable;
1110

1211
/**
1312
* Class HttpExpectationFailedException
1413
*
1514
* Client http exception thrown when server could not meet the requirements of the `expect` header.
1615
*/
17-
class HttpExpectationFailedException extends HttpException {
16+
class HttpExpectationFailedException extends HttpClientException {
1817

1918
/**
2019
* HttpExpectationFailedException constructor.

src/Http/Client/HttpForbiddenException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
77
namespace Jitesoft\Exceptions\Http\Client;
88

9-
use Jitesoft\Exceptions\Http\HttpException;
109
use Throwable;
1110

1211
/**
1312
* Class HttpForbiddenException
1413
*
1514
* Client http exception thrown when a forbidden resource.
1615
*/
17-
class HttpForbiddenException extends HttpException {
16+
class HttpForbiddenException extends HttpClientException {
1817

1918
/**
2019
* HttpForbiddenException constructor.

src/Http/Client/HttpGoneException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
77
namespace Jitesoft\Exceptions\Http\Client;
88

9-
use Jitesoft\Exceptions\Http\HttpException;
109
use Throwable;
1110

1211
/**
1312
* Class HttpGoneException
1413
*
1514
* Client http exception thrown when a resource has been removed and will not be available again.
1615
*/
17-
class HttpGoneException extends HttpException {
16+
class HttpGoneException extends HttpClientException {
1817

1918
/**
2019
* HttpGoneException constructor.

src/Http/Client/HttpImATeapotException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
77
namespace Jitesoft\Exceptions\Http\Client;
88

9-
use Jitesoft\Exceptions\Http\HttpException;
109
use Jitesoft\Exceptions\Http\Server\HttpNotImplementedException;
1110
use Throwable;
1211

@@ -18,7 +17,7 @@
1817
* This is a standardized joke, the http error is sometimes used to indicate that something is not
1918
* fully implemented (in which case @see HttpNotImplementedException would be preferable.
2019
*/
21-
class HttpImATeapotException extends HttpException {
20+
class HttpImATeapotException extends HttpClientException {
2221

2322
/**
2423
* HttpImATeapotException constructor.

src/Http/Client/HttpLengthRequiredException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
77
namespace Jitesoft\Exceptions\Http\Client;
88

9-
use Jitesoft\Exceptions\Http\HttpException;
109
use Throwable;
1110

1211
/**
1312
* Class HttpLengthRequiredException
1413
*
1514
* Client http exception thrown when a content length was not supplied by the client but required by the server.
1615
*/
17-
class HttpLengthRequiredException extends HttpException {
16+
class HttpLengthRequiredException extends HttpClientException {
1817

1918
/**
2019
* HttpLengthRequiredException constructor.

src/Http/Client/HttpMethodNotAllowedException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
77
namespace Jitesoft\Exceptions\Http\Client;
88

9-
use Jitesoft\Exceptions\Http\HttpException;
109
use Throwable;
1110

1211
/**
1312
* Class HttpMethodNotAllowedException
1413
*
1514
* Client http exception thrown when a request method was not supported for the given resource.
1615
*/
17-
class HttpMethodNotAllowedException extends HttpException {
16+
class HttpMethodNotAllowedException extends HttpClientException {
1817

1918
/**
2019
* HttpMethodNotAllowedException constructor.

src/Http/Client/HttpNotAcceptableException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
77
namespace Jitesoft\Exceptions\Http\Client;
88

9-
use Jitesoft\Exceptions\Http\HttpException;
109
use Throwable;
1110

1211
/**
1312
* Class HttpNotAcceptableException
1413
*
1514
* Client http exception thrown when the content requested could not be sent due to the client accept header.
1615
*/
17-
class HttpNotAcceptableException extends HttpException {
16+
class HttpNotAcceptableException extends HttpClientException {
1817

1918
/**
2019
* HttpNotAcceptableException constructor.

0 commit comments

Comments
 (0)