FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cli/src/Support/ServerHttpException.php at main · durable-workflow/cli · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
durable-workflow
/
cli
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cli
/
src
/
Support
/
ServerHttpException.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
50 lines (41 loc) · 1.18 KB
Breadcrumbs
cli
/
src
/
Support
/
ServerHttpException.php
Copy path
File metadata and controls
50 lines (41 loc) · 1.18 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
declare
(strict_types=
1
);
namespace
DurableWorkflow
\
Cli
\
Support
;
use
Throwable
;
/**
* HTTP-level failure returned by the server (4xx / 5xx).
*
* The HTTP status code is preserved as both the exception code and an
* explicit accessor so callers can map it to an {@see ExitCode}.
*/
class
ServerHttpException
extends
ServerException
{
/**
* @param array<string, mixed>|null $body
*/
public
function
__construct
(
string
$
message
,
public
readonly
int
$
statusCode
,
?
Throwable
$
previous
=
null
,
public
readonly
?
array
$
body
=
null
,
) {
parent
::
__construct
(
$
message
,
$
statusCode
,
$
previous
);
}
public
function
reason
(): ?
string
{
$
reason
=
$
this
->
body
[
'
reason
'
] ??
null
;
return
is_string
(
$
reason
) &&
$
reason
!==
''
?
$
reason
:
null
;
}
/**
* @return array<string, mixed>|null
*/
public
function
validationErrors
(): ?
array
{
$
errors
=
$
this
->
body
[
'
validation_errors
'
] ??
$
this
->
body
[
'
errors
'
] ??
null
;
return
is_array
(
$
errors
) ?
$
errors
:
null
;
}
public
function
exitCode
():
int
{
return
ExitCode::
fromHttpStatus
(
$
this
->
statusCode
);
}
}
Back
|
FazBrowse Home
|
New Git URL