This repository was archived by the owner on Sep 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/main/java/com/marklogic/rest/util Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 44
55import org .slf4j .Logger ;
66import org .slf4j .LoggerFactory ;
7+ import org .springframework .http .HttpStatus ;
78import org .springframework .http .client .ClientHttpResponse ;
89import org .springframework .web .client .DefaultResponseErrorHandler ;
910import org .springframework .web .client .HttpClientErrorException ;
@@ -18,8 +19,14 @@ public void handleError(ClientHttpResponse response) throws IOException {
1819 try {
1920 super .handleError (response );
2021 } catch (HttpClientErrorException | HttpServerErrorException ex ) {
21- if (logger .isErrorEnabled ()) {
22- logger .error ("Logging HTTP response body to assist with debugging: " + ex .getResponseBodyAsString ());
22+ String message = "Logging HTTP response body to assist with debugging: " + ex .getResponseBodyAsString ();
23+ if (HttpStatus .SERVICE_UNAVAILABLE .equals (ex .getStatusCode ())) {
24+ if (logger .isDebugEnabled ()) {
25+ logger .debug (message );
26+ }
27+ }
28+ else if (logger .isErrorEnabled ()) {
29+ logger .error (message );
2330 }
2431 throw ex ;
2532 }
You can’t perform that action at this time.
0 commit comments