Skip to content

Commit

Permalink
Fixed order of error handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
adewes committed Aug 17, 2021
1 parent 6238646 commit c843dcd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions message_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ func (b *BasicMessageBroker) DeliverRequest(request *Request, clientInfo *Client

address, err := GetAddress(request.ID)

if _, err := b.directory.EntryFor(address.Operator); err != nil {
return nil, fmt.Errorf("error retrieving directory entry for recipient '%s': %w", address.Operator, err)
}

if err != nil {
return nil, fmt.Errorf("error parsing address: %w", err)
}

if _, err := b.directory.EntryFor(address.Operator); err != nil {
return nil, fmt.Errorf("error retrieving directory entry for recipient '%s': %w", address.Operator, err)
}

// if the remote entry isn't identical to the local one we check if the
// remote endpoint actually has the right to call the given service on
// this endpoint
Expand Down

0 comments on commit c843dcd

Please sign in to comment.