Skip to content

Commit

Permalink
small patch
Browse files Browse the repository at this point in the history
  • Loading branch information
scottburch committed Jan 25, 2021
1 parent b54acf9 commit 9b9252f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions x/crud/client/rest/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"io/ioutil"
"net/http"
"strconv"
"strings"
)

func AccountTxsHandler(cliCtx context.CLIContext) http.HandlerFunc {
Expand Down Expand Up @@ -59,11 +60,11 @@ func AccountTxsHandler(cliCtx context.CLIContext) http.HandlerFunc {
for {
searchResult, err := utils.QueryTxsByEvents(cliCtx, events, page, PAGE_SIZE)
if err != nil {
// Breaking here because an error is returned if we try to get an empty page
// This happens if there is exactly 100 results
break
// rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
// return
if strings.Contains(err.Error(), "page should be within") {
break
}
rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
return
}

response = append(response, searchResult.Txs...)
Expand Down

0 comments on commit 9b9252f

Please sign in to comment.