Skip to content

Commit ea95853

Browse files
committed
Merge remote-tracking branch 'mi-fork/fix-fhir-store-Iam-policy' into feat/fhir-batch-1-resources
2 parents 12ea87f + c14a186 commit ea95853

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

healthcare/fhir/getFhirStoreIamPolicy.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const main = (
2727
auth: new google.auth.GoogleAuth({
2828
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2929
}),
30+
responseType: 'json',
3031
});
3132

3233
const getFhirStoreIamPolicy = async () => {
@@ -38,14 +39,21 @@ const main = (
3839
const resource_ = `projects/${projectId}/locations/${cloudRegion}/datasets/${datasetId}/fhirStores/${fhirStoreId}`;
3940
const request = {resource_};
4041

41-
const fhirStore =
42-
await healthcare.projects.locations.datasets.fhirStores.getIamPolicy(
43-
request
42+
try {
43+
const fhirStore =
44+
await healthcare.projects.locations.datasets.fhirStores.getIamPolicy(
45+
request
46+
);
47+
console.log(
48+
'Got FHIR store IAM policy:',
49+
JSON.stringify(fhirStore.data, null, 2)
4450
);
45-
console.log(
46-
'Got FHIR store IAM policy:',
47-
JSON.stringify(fhirStore.data, null, 2)
48-
);
51+
} catch (error) {
52+
console.error(
53+
'Error getting FHIR store IAM policy:',
54+
error.message || error
55+
);
56+
}
4957
};
5058

5159
getFhirStoreIamPolicy();

0 commit comments

Comments
 (0)