add try catch

This commit is contained in:
harsh mahajan
2026-04-15 11:59:02 +05:30
parent 37540aa4f5
commit 23233d0dcb
@@ -273,12 +273,16 @@ class Screenshots extends Action
$this->appendToLogs($dbForProject, $deployment->getId(), $queueForRealtime, "[$date] [appwrite] Screenshot capturing failed. Deployment will continue. \n");
if (!$screenshotCompleted) {
$this->publishUsage(
project: $project,
site: $site,
publisherForUsage: $publisherForUsage,
metric: METRIC_SCREENSHOTS_FAILED
);
try {
$this->publishUsage(
project: $project,
site: $site,
publisherForUsage: $publisherForUsage,
metric: METRIC_SCREENSHOTS_FAILED
);
} catch (\Throwable) {
// Usage publish is best-effort; preserve the original screenshot exception.
}
}
throw $th;