ECKey: If deriving the private keys fails in toString(), print the exception to the message rather than throwing.

This commit is contained in:
Andreas Schildbach
2016-09-29 11:54:03 +02:00
parent 135d3c7f16
commit b6a6b2605c

View File

@@ -1259,6 +1259,9 @@ public class ECKey implements EncryptableItem {
helper.add("priv WIF", getPrivateKeyAsWiF(params));
} catch (IllegalStateException e) {
// TODO: Make hasPrivKey() work for deterministic keys and fix this.
} catch (Exception e) {
final String message = e.getMessage();
helper.add("priv EXCEPTION", e.getClass().getName() + (message != null ? ": " + message : ""));
}
}
if (creationTimeSeconds > 0)