Skip to content

Commit

Permalink
fix(ref-imp): improved error message for incorrect DID prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
thehenrytsai committed Mar 15, 2021
1 parent 9fc1f1c commit 51b8cf8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/core/versions/latest/Did.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default class Did {
// TODO https://github.com/decentralized-identity/sidetree/issues/470 add network prefix to the didPrefix string

if (!did.startsWith(didPrefix)) {
throw new SidetreeError(ErrorCode.DidIncorrectPrefix);
throw new SidetreeError(ErrorCode.DidIncorrectPrefix, `Expected DID prefix ${didPrefix} not given in DID.`);
}

const didWithoutPrefix = did.split(didPrefix)[1];
Expand Down

0 comments on commit 51b8cf8

Please sign in to comment.