Detect the "504 Gateway Time-out" error from Sushilite-R5 and provide a mention to it, in the response-body.
This commit is contained in:
parent
97e85c2a75
commit
54ebb35161
|
@ -73,7 +73,11 @@ public class SushiliteR5ServiceImpl implements SushiliteR5Service {
|
|||
new ParameterizedTypeReference<Object>() {});
|
||||
} catch (RestClientException rce) {
|
||||
String errorMsg = "Failed to get a response from sushiliteR5!";
|
||||
logger.error(errorMsg + " URI was:\n" + uri + "\n" + rce.getMessage());
|
||||
String message = rce.getMessage();
|
||||
if ( (message != null) && message.contains("504 Gateway Time-out") ) // In this case the parsing-exception is thrown before we get to check the response code..
|
||||
errorMsg += " Reason: 504 Gateway Time-out";
|
||||
|
||||
logger.error(errorMsg + " URI was:\n" + uri + "\n" + message);
|
||||
return ResponseEntity.internalServerError().body(errorMsg);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue