diff --git a/healthcare/fhir/getFhirStore.js b/healthcare/fhir/getFhirStore.js index 810d6a38db..a12f396f6c 100644 --- a/healthcare/fhir/getFhirStore.js +++ b/healthcare/fhir/getFhirStore.js @@ -27,6 +27,7 @@ const main = ( auth: new google.auth.GoogleAuth({ scopes: ['https://www.googleapis.com/auth/cloud-platform'], }), + responseType: 'json', }); const getFhirStore = async () => { @@ -38,9 +39,13 @@ const main = ( const name = `projects/${projectId}/locations/${cloudRegion}/datasets/${datasetId}/fhirStores/${fhirStoreId}`; const request = {name}; - const fhirStore = - await healthcare.projects.locations.datasets.fhirStores.get(request); - console.log(fhirStore.data); + try { + const fhirStore = + await healthcare.projects.locations.datasets.fhirStores.get(request); + console.log(fhirStore.data); + } catch (error) { + console.error('Error getting FHIR store:', error.message || error); + } }; getFhirStore();