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

Update missing error catch #218

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/steps/groups/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {
createGroupSettingsEntity,
MemberType,
} from './converters';
import { authorizationErrorResponses } from '../../gsuite/clients/GSuiteClient';
import { isAuthorizationError } from '../../utils/isAuthorizationError';

const GROUPS_LOG_INTERVAL = 50;
Expand Down Expand Up @@ -127,9 +126,7 @@ async function iterateGroupMembers(
} catch (err) {
if (
err instanceof IntegrationProviderAuthorizationError &&
authorizationErrorResponses.filter((errorText) =>
err.statusText.match(errorText),
).length > 0
isAuthorizationError(err.statusText)
) {
context.logger.publishWarnEvent({
name: IntegrationWarnEventName.MissingPermission,
Expand Down Expand Up @@ -324,9 +321,7 @@ export async function fetchGroupSettings(
} catch (err) {
if (
err instanceof IntegrationProviderAuthorizationError &&
authorizationErrorResponses.filter((errorText) =>
err.statusText.match(errorText),
).length > 0
isAuthorizationError(err.statusText)
) {
context.logger.publishWarnEvent({
name: IntegrationWarnEventName.MissingPermission,
Expand Down
Loading