Skip to content

Commit

Permalink
Limit the length of the logged error-summary for external-groups syncs
Browse files Browse the repository at this point in the history
  • Loading branch information
forevermatt committed Sep 9, 2024
1 parent 236c123 commit 1faf4eb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions application/common/components/ExternalGroupsSync.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,16 @@ private static function syncSet(string $appPrefix, string $googleSheetId)
));

if (! empty($errors)) {
Yii::error(sprintf(
'Errors that occurred while syncing %s external groups: %s',
$errorSummary = sprintf(
'Errors that occurred (%s) while syncing %s external groups: %s',
count($errors),
$appPrefix,
join(" / ", $errors)
));
);
if (strlen($errorSummary) > 1000) {
$errorSummary = substr($errorSummary, 0, 997) . '...';
}
Yii::error($errorSummary);
}
}

Expand Down

0 comments on commit 1faf4eb

Please sign in to comment.