diff --git a/src/main/java/com/apicatalog/did/key/DidKey.java b/src/main/java/com/apicatalog/did/key/DidKey.java index 77c0886..98dcb8c 100644 --- a/src/main/java/com/apicatalog/did/key/DidKey.java +++ b/src/main/java/com/apicatalog/did/key/DidKey.java @@ -64,11 +64,11 @@ public static final DidKey from(final Did did, final MultibaseDecoder bases, fin throw new IllegalArgumentException("The given DID method [" + did.getMethod() + "] is not 'key'. DID [" + did.toString() + "]."); } - final Multibase base = bases.getBase(did.getMethodSpecificId()).orElseThrow(() -> new IllegalArgumentException("Cannot detect did:key base encoding.")); + final Multibase base = bases.getBase(did.getMethodSpecificId()).orElseThrow(() -> new IllegalArgumentException("Unsupported did:key base encoding. DID [" + did.toString() + "].")); final byte[] decoded = base.decode(did.getMethodSpecificId()); - final Multicodec codec = codecs.getCodec(decoded).orElseThrow(() -> new IllegalArgumentException("Cannot detect did:key codec.")); + final Multicodec codec = codecs.getCodec(decoded).orElseThrow(() -> new IllegalArgumentException("Unsupported did:key codec. DID [" + did.toString() + "].")); final byte[] rawKey = codec.decode(decoded);