fix: Fixing crash on status-go exception when calling `getOwnedCollectiblesAsync`

This commit is contained in:
Alex Jbanca 2024-07-17 09:17:05 +03:00 committed by Alex Jbanca
parent 1b67063eac
commit 5fc3b37fbd
1 changed files with 9 additions and 3 deletions

View File

@ -138,12 +138,18 @@ QtObject:
else:
offset = self.tempItems.len
self.fetchFromStart = false
let response = backend_collectibles.getOwnedCollectiblesAsync(self.requestId, self.chainIds, self.addresses, self.filter, offset, FETCH_BATCH_COUNT_DEFAULT, self.dataType, self.fetchCriteria)
if response.error != nil:
try:
let response = backend_collectibles.getOwnedCollectiblesAsync(self.requestId, self.chainIds, self.addresses, self.filter, offset, FETCH_BATCH_COUNT_DEFAULT, self.dataType, self.fetchCriteria)
if response.error != nil:
self.model.setIsFetching(false)
self.model.setIsError(true)
self.fetchFromStart = true
error "error fetching collectibles entries: ", response.error
except Exception as e:
error "error fetching collectibles entries: ", e.msg
self.model.setIsFetching(false)
self.model.setIsError(true)
self.fetchFromStart = true
error "error fetching collectibles entries: ", response.error
proc onModelLoadMoreItems(self: Controller) {.slot.} =
if self.loadType.isAutoLoad():