From 14f64f9db493f03ba338ef3ce50e3c1a1bae639e Mon Sep 17 00:00:00 2001 From: Konstantin Shcheglov Date: Wed, 27 May 2020 15:28:11 +0000 Subject: [PATCH] Add CrashReportingAttachmentsBuilder.forException() R=brianwilkerson@google.com Change-Id: I66793d61e02d25931d230e8b9e3541255ac6324a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149054 Reviewed-by: Brian Wilkerson Commit-Queue: Konstantin Shcheglov --- pkg/analysis_server/lib/src/analysis_server.dart | 10 ++++++++-- .../lib/src/server/crash_reporting_attachments.dart | 7 +++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart index 4cd286be1c4..6de618f8c31 100644 --- a/pkg/analysis_server/lib/src/analysis_server.dart +++ b/pkg/analysis_server/lib/src/analysis_server.dart @@ -264,8 +264,14 @@ class AnalysisServer extends AbstractAnalysisServer { }); }, (exception, stackTrace) { AnalysisEngine.instance.instrumentationService.logException( - FatalException('Failed to handle request: ${request.method}', - exception, stackTrace)); + FatalException( + 'Failed to handle request: ${request.method}', + exception, + stackTrace, + ), + null, + crashReportingAttachmentsBuilder.forException(exception), + ); }); } diff --git a/pkg/analysis_server/lib/src/server/crash_reporting_attachments.dart b/pkg/analysis_server/lib/src/server/crash_reporting_attachments.dart index 281c6d2fa16..0648968bbcf 100644 --- a/pkg/analysis_server/lib/src/server/crash_reporting_attachments.dart +++ b/pkg/analysis_server/lib/src/server/crash_reporting_attachments.dart @@ -10,6 +10,13 @@ class CrashReportingAttachmentsBuilder { static final CrashReportingAttachmentsBuilder empty = CrashReportingAttachmentsBuilder(); + /// Return attachments with information about the analysis exception. + List forException( + Object exception, + ) { + return const []; + } + /// Return attachments with information about the analysis exception. List forExceptionResult( ExceptionResult result,