Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
Easy Http SDK
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Back End
Easy Http SDK
Commits
7cdf8e78
Commit
7cdf8e78
authored
Feb 23, 2023
by
谢宇轩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 调整默认返回值逻辑的处理范围
parent
07babe89
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
30 deletions
+18
-30
Application.php
src/Application.php
+18
-30
No files found.
src/Application.php
View file @
7cdf8e78
...
@@ -238,21 +238,11 @@ class Application implements ClientInterface
...
@@ -238,21 +238,11 @@ class Application implements ClientInterface
if
(
$response
->
getStatusCode
()
>=
500
)
{
if
(
$response
->
getStatusCode
()
>=
500
)
{
if
(
$this
->
logger
)
{
if
(
$this
->
logger
)
{
$this
->
logger
->
error
(
"sdk error,
paypal
service fail"
,
$context
);
$this
->
logger
->
error
(
"sdk error,
Upstream
service fail"
,
$context
);
}
}
throw
new
SdkException
(
"SDK Upstream Failed"
,
$request
,
$response
,
[]);
throw
new
ApplicationException
(
"SDK Upstream Failed"
,
$request
,
[]);
}
}
if
(
in_array
(
$response
->
getStatusCode
(),
[
404
,
405
]))
{
if
(
$this
->
logger
)
{
$this
->
logger
->
error
(
"sdk error, endpoint not found"
,
$context
);
}
throw
new
ApplicationException
(
"Api Endpoint Not Found."
,
$request
,
[]);
}
$rpcResult
=
[];
if
(
$response
->
getStatusCode
()
!=
304
)
{
try
{
try
{
$rpcResult
=
$this
->
option
->
handlingPolicy
()
->
process
(
$response
);
$rpcResult
=
$this
->
option
->
handlingPolicy
()
->
process
(
$response
);
}
catch
(
GuiltyResultException
$exception
)
{
}
catch
(
GuiltyResultException
$exception
)
{
...
@@ -273,8 +263,6 @@ class Application implements ClientInterface
...
@@ -273,8 +263,6 @@ class Application implements ClientInterface
}
}
throw
new
ApplicationException
(
"Content Format error."
,
$request
,
[]);
throw
new
ApplicationException
(
"Content Format error."
,
$request
,
[]);
}
}
}
$version
=
$response
->
getHeader
(
'ETag'
);
$version
=
$response
->
getHeader
(
'ETag'
);
if
(
!
empty
(
$version
))
{
if
(
!
empty
(
$version
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment