Skip to content

Commit

Permalink
add separate error variable for setLink() (#642)
Browse files Browse the repository at this point in the history
* add separate error variable for setLink()

* typo fix
  • Loading branch information
yushihang authored Jun 4, 2024
1 parent d4d8bf6 commit 73f24d0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/core/services/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,10 @@ func (ls *Link) IssueClaim(ctx context.Context, sessionID string, issuerDID w3c.
}

if err := ls.validate(ctx, link); err != nil {
err := ls.sessionManager.SetLink(ctx, linkState.CredentialStateCacheKey(linkID.String(), sessionID), *linkState.NewStateError(err))
if err != nil {
log.Error(ctx, "cannot set the sate", "err", err)
return err
setLinkError := ls.sessionManager.SetLink(ctx, linkState.CredentialStateCacheKey(linkID.String(), sessionID), *linkState.NewStateError(err))
if setLinkError != nil {
log.Error(ctx, "cannot set the state", "err", setLinkError)
return setLinkError
}

return err
Expand Down

0 comments on commit 73f24d0

Please sign in to comment.