@@ -14,17 +14,17 @@ const UnavailableProofErrorName = "UnavailableProof"
1414
1515func NewUnavailableProofError (p ucan.Link , cause error ) vdm.ErrorModel {
1616 return vdm.ErrorModel {
17- Name : UnavailableProofErrorName ,
18- Message : fmt .Sprintf ("linked proof %s could not be resolved: %s" , p .String (), cause .Error ()),
17+ ErrorName : UnavailableProofErrorName ,
18+ Message : fmt .Sprintf ("linked proof %s could not be resolved: %s" , p .String (), cause .Error ()),
1919 }
2020}
2121
2222const DIDKeyResolutionErrorName = "DIDKeyResolutionError"
2323
2424func NewDIDKeyResolutionError (d did.DID , cause error ) vdm.ErrorModel {
2525 return vdm.ErrorModel {
26- Name : DIDKeyResolutionErrorName ,
27- Message : fmt .Sprintf ("unable to resolve %s key: %s" , d .String (), cause .Error ()),
26+ ErrorName : DIDKeyResolutionErrorName ,
27+ Message : fmt .Sprintf ("unable to resolve %s key: %s" , d .String (), cause .Error ()),
2828 }
2929}
3030
@@ -38,26 +38,26 @@ func NewExpiredError(t ucan.Token) vdm.ErrorModel {
3838 name = "proof"
3939 }
4040 return vdm.ErrorModel {
41- Name : ExpiredErrorName ,
42- Message : fmt .Sprintf ("%s %s has expired on %s" , name , t .Link (), time .Unix (int64 (* t .Expiration ()), 0 ).Format (time .RFC3339 )),
41+ ErrorName : ExpiredErrorName ,
42+ Message : fmt .Sprintf ("%s %s has expired on %s" , name , t .Link (), time .Unix (int64 (* t .Expiration ()), 0 ).Format (time .RFC3339 )),
4343 }
4444}
4545
4646const TooEarlyErrorName = "TooEarly"
4747
4848func NewTooEarlyError (t ucan.Delegation ) vdm.ErrorModel {
4949 return vdm.ErrorModel {
50- Name : ExpiredErrorName ,
51- Message : fmt .Sprintf ("proof %s is not valid before %s" , t .Link (), time .Unix (int64 (* t .NotBefore ()), 0 ).Format (time .RFC3339 )),
50+ ErrorName : TooEarlyErrorName ,
51+ Message : fmt .Sprintf ("proof %s is not valid before %s" , t .Link (), time .Unix (int64 (* t .NotBefore ()), 0 ).Format (time .RFC3339 )),
5252 }
5353}
5454
5555const MalformedArgumentsErrorName = "MalformedArguments"
5656
5757func NewMalformedArgumentsError (cmd ucan.Command , cause error ) vdm.ErrorModel {
5858 return vdm.ErrorModel {
59- Name : MalformedArgumentsErrorName ,
60- Message : fmt .Sprintf ("malformed arguments for command %s: %s" , cmd , cause .Error ()),
59+ ErrorName : MalformedArgumentsErrorName ,
60+ Message : fmt .Sprintf ("malformed arguments for command %s: %s" , cmd , cause .Error ()),
6161 }
6262}
6363
@@ -76,8 +76,8 @@ func NewInvalidSignatureError(token ucan.Token, verifier ucan.Verifier) vdm.Erro
7676 }, "\n " )
7777 }
7878 return vdm.ErrorModel {
79- Name : InvalidSignatureErrorName ,
80- Message : message ,
79+ ErrorName : InvalidSignatureErrorName ,
80+ Message : message ,
8181 }
8282}
8383
@@ -86,7 +86,7 @@ const UnverifiableSignatureErrorName = "UnverifiableSignature"
8686func NewUnverifiableSignatureError (token ucan.Token , cause error ) vdm.ErrorModel {
8787 issuer := token .Issuer ().DID ()
8888 return vdm.ErrorModel {
89- Name : UnverifiableSignatureErrorName ,
90- Message : fmt .Sprintf ("proof %s issued by %s cannot be verified: %s" , token .Link (), issuer , cause .Error ()),
89+ ErrorName : UnverifiableSignatureErrorName ,
90+ Message : fmt .Sprintf ("proof %s issued by %s cannot be verified: %s" , token .Link (), issuer , cause .Error ()),
9191 }
9292}
0 commit comments