Skip to content

Commit

Permalink
identity: handle errors when doing LookupDID should not error, just i…
Browse files Browse the repository at this point in the history
…nvalid handle
  • Loading branch information
bnewbold committed Sep 13, 2023
1 parent 56858f8 commit 8a590be
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions atproto/identity/base_directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ func (d *BaseDirectory) LookupDID(ctx context.Context, did syntax.DID) (*Identit
return nil, err
}
resolvedDID, err := d.ResolveHandle(ctx, declared)
if err != nil {
if err != nil && err != ErrHandleNotFound {
return nil, err
}
if resolvedDID == did {
} else if ErrHandleNotFound == err || resolvedDID != did {
ident.Handle = syntax.Handle("handle.invalid")
} else {
ident.Handle = declared
}

Expand Down

0 comments on commit 8a590be

Please sign in to comment.