From b5c8f2a43fe0df421912eabc0cee29397e746522 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Fri, 10 Jun 2016 06:48:16 -0700 Subject: [PATCH] print stack traces from the analysis server (#4507) --- .../flutter_tools/lib/src/commands/analyze.dart | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/flutter_tools/lib/src/commands/analyze.dart b/packages/flutter_tools/lib/src/commands/analyze.dart index 92561061d2..82bb53fa1a 100644 --- a/packages/flutter_tools/lib/src/commands/analyze.dart +++ b/packages/flutter_tools/lib/src/commands/analyze.dart @@ -553,7 +553,11 @@ class AnalysisServer { _handleServerError(response['params']); } } else if (response['error'] != null) { - printError('Error from the analysis server: ${response['error']['message']}'); + // Fields are 'code', 'message', and 'stackTrace'. + Map error = response['error']; + printError('Error response from the server: ${error['code']} ${error['message']}'); + if (error['stackTrace'] != null) + printError(error['stackTrace']); } } } @@ -566,8 +570,11 @@ class AnalysisServer { } } - void _handleServerError(Map errorInfo) { - printError('Error from the analysis server: ${errorInfo['message']}'); + void _handleServerError(Map error) { + // Fields are 'isFatal', 'message', and 'stackTrace'. + printError('Error from the analysis server: ${error['message']}'); + if (error['stackTrace'] != null) + printError(error['stackTrace']); } void _handleAnalysisIssues(Map issueInfo) {