mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-17 20:50:44 +00:00
Merge branch 'dev' into feature/CTLE-434-oms-update-business-logic
# Conflicts: # qqq-middleware-api/src/test/java/com/kingsrook/qqq/api/javalin/QJavalinApiHandlerTest.java
This commit is contained in:
@ -517,18 +517,28 @@ public class BaseAPIActionUtil
|
||||
|
||||
int statusCode = response.getStatusCode();
|
||||
String resultString = response.getContent();
|
||||
String errorMessage = "HTTP " + request.getMethod() + " for table [" + table.getName() + "] failed with status " + statusCode + ": " + resultString;
|
||||
LOG.error("HTTP " + request.getMethod() + " failed", logPair("table", table.getName()), logPair("statusCode", statusCode), logPair("responseContent", StringUtils.safeTruncate(resultString, 1024, "...")));
|
||||
|
||||
boolean didLog = false;
|
||||
if("GET".equals(request.getMethod()))
|
||||
{
|
||||
if(statusCode == HttpStatus.SC_NOT_FOUND)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if(statusCode == HttpStatus.SC_BAD_GATEWAY)
|
||||
{
|
||||
LOG.info("HTTP " + request.getMethod() + " failed", logPair("table", table.getName()), logPair("statusCode", statusCode), logPair("responseContent", StringUtils.safeTruncate(resultString, 1024, "...")));
|
||||
didLog = true;
|
||||
}
|
||||
}
|
||||
|
||||
throw (new QException(errorMessage));
|
||||
if(!didLog)
|
||||
{
|
||||
LOG.warn("HTTP " + request.getMethod() + " failed", logPair("table", table.getName()), logPair("statusCode", statusCode), logPair("responseContent", StringUtils.safeTruncate(resultString, 1024, "...")));
|
||||
}
|
||||
|
||||
String warningMessage = "HTTP " + request.getMethod() + " for table [" + table.getName() + "] failed with status " + statusCode + ": " + resultString;
|
||||
throw (new QException(warningMessage));
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user