Only append elements when non-empty

Cleans up error responses.
pull/305/head
Andrew Gaul 2019-05-10 19:16:51 +07:00
rodzic 6389e45670
commit 21ea62ec93
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -63,6 +63,10 @@ public final class S3Exception extends Exception {
@Override
public String getMessage() {
return error + " " + elements;
StringBuilder builder = new StringBuilder().append(error);
if (!elements.isEmpty()) {
builder.append(" ").append(elements);
}
return builder.toString();
}
}