From 5fc3b37fbdd3a49dab2ed339461866dbbae0f9a2 Mon Sep 17 00:00:00 2001 From: Alex Jbanca Date: Wed, 17 Jul 2024 09:17:05 +0300 Subject: [PATCH] fix: Fixing crash on status-go exception when calling `getOwnedCollectiblesAsync` --- .../shared_modules/collectibles/controller.nim | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/app/modules/shared_modules/collectibles/controller.nim b/src/app/modules/shared_modules/collectibles/controller.nim index 82e67847ef..d858a2a6e7 100644 --- a/src/app/modules/shared_modules/collectibles/controller.nim +++ b/src/app/modules/shared_modules/collectibles/controller.nim @@ -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():