Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit42a724d

Browse files
Alexander Novikovscarbo87
Alexander Novikov
authored andcommitted
503 Service Temporarily Unavailable
1 parentab05623 commit42a724d

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespaceDsl\MyTarget\Transport\Exception;
4+
5+
class ServiceTemporarilyUnavailableExceptionextends ServerErrorException
6+
implements ApiException
7+
{
8+
}

‎src/Transport/Middleware/Impl/ResponseValidatingMiddleware.php‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ public function request(RequestInterface $request, HttpMiddlewareStack $stack, C
2121
$code =$response->getStatusCode();
2222

2323
if ($code >=500 &&$code <600) {
24-
thrownewex\ServerErrorException("MyTarget:{$code} Server Error",$request,$response);
24+
if (503 ===$code) {
25+
thrownewex\ServiceTemporarilyUnavailableException("MyTarget:{$code} Server Error",$request,$response);
26+
}
27+
thrownewex\ServerErrorException("503 Service Temporarily Unavailable",$request,$response);
2528
}
2629

2730
if ($code >=400 &&$code <500) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp