Skip to content

Commit 65ca2cc

Browse files
committed
Change DidResolutionException did param to String
1 parent 69a05b9 commit 65ca2cc

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

src/main/java/com/apicatalog/did/resolver/DidMethodResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public ResolvedDidDocument resolve(Did did) throws DidResolutionException {
2424
final DidResolver resolver = resolvers.get(did.getMethod());
2525

2626
if (resolver == null) {
27-
throw new DidResolutionException(did, Code.UnsupportedMethod);
27+
throw new DidResolutionException(did.toString(), Code.UnsupportedMethod);
2828
}
2929
return resolver.resolve(did);
3030
}

src/main/java/com/apicatalog/did/resolver/DidResolutionException.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.apicatalog.did.resolver;
22

3-
import com.apicatalog.did.Did;
4-
53
/**
64
* Exception thrown during DID resolution.
75
* <p>
@@ -27,7 +25,7 @@ public enum Code {
2725
Internal,
2826
}
2927

30-
protected final Did did;
28+
protected final String did;
3129
protected final Code code;
3230

3331
/**
@@ -36,7 +34,7 @@ public enum Code {
3634
* @param did the DID being resolved (may be {@code null})
3735
* @param code error code
3836
*/
39-
public DidResolutionException(Did did, Code code) {
37+
public DidResolutionException(String did, Code code) {
4038
this.did = did;
4139
this.code = code;
4240
}
@@ -48,7 +46,7 @@ public DidResolutionException(Did did, Code code) {
4846
* @param code error code
4947
* @param message detail message
5048
*/
51-
public DidResolutionException(Did did, Code code, String message) {
49+
public DidResolutionException(String did, Code code, String message) {
5250
super(message);
5351
this.did = did;
5452
this.code = code;
@@ -63,7 +61,7 @@ public DidResolutionException(Did did, Code code, String message) {
6361
* @param did the DID being resolved (may be {@code null})
6462
* @param e the cause
6563
*/
66-
public DidResolutionException(Did did, Throwable e) {
64+
public DidResolutionException(String did, Throwable e) {
6765
super(e);
6866
this.did = did;
6967
this.code = Code.Internal;
@@ -79,7 +77,7 @@ public DidResolutionException(Did did, Throwable e) {
7977
* @param message detail message
8078
* @param e the cause
8179
*/
82-
public DidResolutionException(Did did, String message, Throwable e) {
80+
public DidResolutionException(String did, String message, Throwable e) {
8381
super(message, e);
8482
this.did = did;
8583
this.code = Code.Internal;
@@ -90,7 +88,7 @@ public DidResolutionException(Did did, String message, Throwable e) {
9088
*
9189
* @return the DID, or {@code null}
9290
*/
93-
public Did getDid() {
91+
public String getDid() {
9492
return did;
9593
}
9694

0 commit comments

Comments
 (0)