From d8425206aaa75905c0275845182d1699790c9969 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Tue, 27 Aug 2024 10:01:53 +1200 Subject: [PATCH] Add inner try-catch to catch biolucida request issue --- components/ImagesGallery/ImagesGallery.vue | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/components/ImagesGallery/ImagesGallery.vue b/components/ImagesGallery/ImagesGallery.vue index 7e962d15..b03c1712 100644 --- a/components/ImagesGallery/ImagesGallery.vue +++ b/components/ImagesGallery/ImagesGallery.vue @@ -54,9 +54,17 @@ const getThumbnailData = async (datasetDoi, datasetId, datasetVersion, datasetFa await scicrunch.getDatasetInfoFromDOI(datasetDoi).then(response => { scicrunch_response = response }) - await biolucida.searchDataset(datasetId).then(response => { - biolucida_response = response - }) + // Inner try-catch for biolucida request errors + try { + await biolucida.searchDataset(datasetId).then(response => { + biolucida_response = response + }) + } catch (error) { + console.error( + 'Hit error in the biolucida request. ( pages/_datasetId.vue ). Error: ', + error + ) + } if (scicrunch_response.data.result.length > 0) { scicrunchData = scicrunch_response.data.result[0]