DefaultResponseErrorHandler shows full error details

Closes gh-27552
This commit is contained in:
Rossen Stoyanchev
2021-10-13 20:51:10 +01:00
parent fcf4315e02
commit a178bbe86f
3 changed files with 16 additions and 54 deletions

View File

@@ -60,16 +60,11 @@ public abstract class LogFormatUtils {
return "";
}
String result;
if (value instanceof CharSequence) {
result = "\"" + value + "\"";
try {
result = value.toString();
}
else {
try {
result = value.toString();
}
catch (Throwable ex) {
result = ex.toString();
}
catch (Throwable ex) {
result = ex.toString();
}
if (maxLength != -1) {
result = (result.length() > maxLength ? result.substring(0, maxLength) + " (truncated)..." : result);
@@ -77,6 +72,9 @@ public abstract class LogFormatUtils {
if (replaceNewlines) {
result = result.replace("\n", "<LF>").replace("\r", "<CR>");
}
if (value instanceof CharSequence) {
result = "\"" + result + "\"";
}
return result;
}