Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1389)

Unified Diff: pkg/analysis_server/lib/src/analysis_server.dart

Issue 1232243004: Ensure that there is a stack trace when reporting a server error (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/analysis_server.dart
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index e71ac0499f1b54677cc6ad7e97e5e7381bed4891..c88b3588e469b901e052f7d17e9685630db1e475 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -867,7 +867,15 @@ class AnalysisServer {
if (stackTrace != null) {
stackTraceString = stackTrace.toString();
} else {
- stackTraceString = 'null stackTrace';
+ try {
+ throw 'ignored';
+ } catch (ignored, stackTrace) {
+ stackTraceString = stackTrace.toString();
+ }
+ if (stackTraceString == null) {
+ // This code should be unreachable.
+ stackTraceString = 'null stackTrace';
+ }
}
// send the notification
channel.sendNotification(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698