feat(exceptions): introduce NonReportableException to handle known errors and update Handler for selective reporting

This commit is contained in:
Andras Bacsai
2025-09-08 09:18:25 +02:00
parent 45c75ad9c1
commit a243b99df4
3 changed files with 43 additions and 7 deletions

View File

@@ -29,6 +29,7 @@ class Handler extends ExceptionHandler
*/
protected $dontReport = [
ProcessException::class,
NonReportableException::class,
];
/**
@@ -110,9 +111,14 @@ class Handler extends ExceptionHandler
);
}
);
// Check for errors that should not be reported to Sentry
if (str($e->getMessage())->contains('No space left on device')) {
// Log locally but don't send to Sentry
logger()->warning('Disk space error: '.$e->getMessage());
return;
}
Integration::captureUnhandledException($e);
});
}