Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
INT-9705: add throwMissingPermissionError flag for edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
gastonyelmini committed Oct 9, 2023
1 parent ebf2f94 commit 9a4fff5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/google-cloud/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export class Client {
async iterateApi<T>(
fn: (nextPageToken?: string) => Promise<PageableGaxiosResponse<T>>,
callback: (data: T) => Promise<void>,
throwMissingPermissionError?: boolean,
) {
return this.forEachPage(async (nextPageToken) => {
try {
Expand All @@ -114,6 +115,9 @@ export class Client {
name: IntegrationWarnEventName.MissingPermission,
description: `Received authorization error when attempting to call ${err.endpoint}. Please review permissions in the integration documentation.`,
});

if (throwMissingPermissionError) throw err;

return;
}

Expand Down

0 comments on commit 9a4fff5

Please sign in to comment.