Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OTSWithFeign
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Siva Naga Someswara Jatla
OTSWithFeign
Commits
cf4b3f23
Commit
cf4b3f23
authored
May 06, 2020
by
Amar Bogari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
condition added.
parent
a8c26f2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
CustomErrorDecoder.java
...um/offertransactionservice/config/CustomErrorDecoder.java
+3
-4
No files found.
src/main/java/com/nisum/offertransactionservice/config/CustomErrorDecoder.java
View file @
cf4b3f23
package
com
.
nisum
.
offertransactionservice
.
config
;
import
feign.FeignException
;
import
feign.Request
;
import
feign.Response
;
import
feign.RetryableException
;
import
feign.codec.ErrorDecoder
;
import
org.springframework.http.HttpStatus
;
import
java.util.Date
;
import
java.util.Objects
;
public
class
CustomErrorDecoder
implements
ErrorDecoder
{
...
...
@@ -17,8 +16,8 @@ public class CustomErrorDecoder implements ErrorDecoder {
public
Exception
decode
(
String
methodKey
,
Response
response
)
{
Exception
exception
=
defaultErrorDecoder
.
decode
(
methodKey
,
response
);
if
(
response
.
status
()
==
HttpStatus
.
REQUEST_TIMEOUT
.
value
(
)){
return
new
RetryableException
(
408
,
"408 error"
,
response
.
request
().
httpMethod
(),
new
Date
(),
response
.
request
());
if
(
Objects
.
equals
(
response
.
status
(),
HttpStatus
.
REQUEST_TIMEOUT
.
value
()
)){
return
new
RetryableException
(
HttpStatus
.
REQUEST_TIMEOUT
.
value
()
,
"408 error"
,
response
.
request
().
httpMethod
(),
new
Date
(),
response
.
request
());
}
return
exception
;
}
...
...
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