[analysis_server] Fix crash reporting bug, casting exception to a string

Brian noticed this running unit tests. Who knows how many bug reports we
have missed from this -- we can only hope it is very few.

```
type '_TypeError' is not a subtype of type 'String'

package:analysis_server/src/server/error_notifier.dart 26:7        ErrorNotifier.logException
package:analysis_server/src/analysis_server.dart 266:54            AnalysisServer.handleRequest.<fn>
dart:async/zone.dart 1222:13                                       _rootRunBinary
dart:async/zone.dart 1107:19                                       _CustomZone.runBinary
dart:async/zone.dart 1601:18                                       runZonedGuarded.<fn>
dart:async/zone.dart 751:19                                        _ZoneDelegate.handleUncaughtError
...
```
Change-Id: Ib83dc99a88a1566ead5d59a9f71afc80416eb341
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151464
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
Mike Fairhurst 2020-06-17 07:11:30 +00:00 committed by commit-bot@chromium.org
parent 1046888b1b
commit aa3f7dc4e9

View file

@ -23,7 +23,7 @@ class ErrorNotifier extends NoopInstrumentationService {
exception = exception.rootCaughtException;
// TODO(mfairhurst): Use the outermost message rather than the innermost
// exception as its own message.
message = exception.exception;
message = exception.message;
}
server.sendServerErrorNotification(message, exception, stackTrace,