Add comment explaining exception message mangling

This commit is contained in:
Chris Beams 2020-04-26 21:27:24 +02:00
parent f4b4f5ad89
commit f5803492bd
No known key found for this signature in database
GPG Key ID: 3D214F8F5BC5ED73

View File

@ -150,6 +150,9 @@ public class CliMain {
}
}
} catch (StatusRuntimeException ex) {
// This exception is thrown if the client-provided password credentials do not
// match the value set on the server. The actual error message is in a nested
// exception and we clean it up a bit to make it more presentable.
Throwable t = ex.getCause() == null ? ex : ex.getCause();
err.println("Error: " + t.getMessage().replace("UNAUTHENTICATED: ", ""));
exit(EXIT_FAILURE);