mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-17 20:50:44 +00:00
more changes to help reduce warnings that should probably be infos in loggly
This commit is contained in:
@ -505,8 +505,20 @@ 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, "...")));
|
||||
|
||||
if("GET".equals(request.getMethod()))
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
// bad gateways are not our fault and don't happen often, so just log an info on them //
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
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, "...")));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
LOG.warn("HTTP " + request.getMethod() + " failed", logPair("table", table.getName()), logPair("statusCode", statusCode), logPair("responseContent", StringUtils.safeTruncate(resultString, 1024, "...")));
|
||||
|
||||
if("GET".equals(request.getMethod()))
|
||||
{
|
||||
@ -516,7 +528,8 @@ public class BaseAPIActionUtil
|
||||
}
|
||||
}
|
||||
|
||||
throw (new QException(errorMessage));
|
||||
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