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

Unified Diff: pkg/compiler/lib/src/apiimpl.dart

Issue 1914973002: Reinsert (and test) handling of exceptions from user code. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments Created 4 years, 8 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 | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/apiimpl.dart
diff --git a/pkg/compiler/lib/src/apiimpl.dart b/pkg/compiler/lib/src/apiimpl.dart
index 3fe63b6a34d04449cf97a2d77f51a41881cf9fe9..3046dfd417db49155111fb3239d09551dfe77325 100644
--- a/pkg/compiler/lib/src/apiimpl.dart
+++ b/pkg/compiler/lib/src/apiimpl.dart
@@ -278,18 +278,33 @@ class CompilerImpl extends Compiler {
void callUserHandler(Message message, Uri uri, int begin, int end,
String text, api.Diagnostic kind) {
- userHandlerTask.measure(() {
- handler.report(message, uri, begin, end, text, kind);
- });
+ try {
+ userHandlerTask.measure(() {
+ handler.report(message, uri, begin, end, text, kind);
+ });
+ } catch (ex, s) {
+ reportCrashInUserCode('Uncaught exception in diagnostic handler', ex, s);
+ rethrow;
+ }
}
Future callUserProvider(Uri uri) {
- return userProviderTask.measure(() => provider.readFromUri(uri));
+ try {
+ return userProviderTask.measure(() => provider.readFromUri(uri));
+ } catch (ex, s) {
+ reportCrashInUserCode('Uncaught exception in input provider', ex, s);
+ rethrow;
+ }
}
Future<Packages> callUserPackagesDiscovery(Uri uri) {
- return userPackagesDiscoveryTask
- .measure(() => options.packagesDiscoveryProvider(uri));
+ try {
+ return userPackagesDiscoveryTask
+ .measure(() => options.packagesDiscoveryProvider(uri));
+ } catch (ex, s) {
+ reportCrashInUserCode('Uncaught exception in package discovery', ex, s);
+ rethrow;
+ }
}
Uri resolvePatchUri(String libraryName) {
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698