Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-tron committed Sep 27, 2024
1 parent 7f9bd88 commit e22871d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/api/jetton_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ func (h *Handler) GetAccountJettonBalance(ctx context.Context, params oas.GetAcc
}
wallets, err := h.storage.GetJettonWalletsByOwnerAddress(ctx, account.ID, &jettonAccount.ID, slices.Contains(params.SupportedExtensions, "custom_payload"))
if errors.Is(err, core.ErrEntityNotFound) {
return &oas.JettonBalance{}, nil
return nil, toError(http.StatusNotFound, err)
}
if err != nil {
return nil, toError(http.StatusInternalServerError, err)
}
if len(wallets) == 0 {
return &oas.JettonBalance{}, toError(http.StatusNotFound, fmt.Errorf("account %v has no jetton wallet %v", account.ID, jettonAccount.ID))
return nil, toError(http.StatusNotFound, fmt.Errorf("account %v has no jetton wallet %v", account.ID, jettonAccount.ID))
}
jettonBalance, err := h.convertJettonBalance(ctx, wallets[0], params.Currencies)
if err != nil {
Expand Down

0 comments on commit e22871d

Please sign in to comment.