Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/apiimpl.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/apiimpl.dart b/sdk/lib/_internal/compiler/implementation/apiimpl.dart |
| index 9f24fc63d2d6ff54a701a543e3dd905a5e346d73..6e27c0b8cf98fe11d4eb29235e6beb9d087f7644 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/apiimpl.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/apiimpl.dart |
| @@ -174,14 +174,10 @@ class Compiler extends leg.Compiler { |
| // directly. In effect, we don't support truly asynchronous API. |
| text = deprecatedFutureValue(provider(resourceUri)); |
| } catch (exception) { |
| - if (node != null) { |
| - cancel("$exception", node: node); |
| - } else { |
| - reportError( |
| - null, |
| + reportError( |
| + node, |
| leg.MessageKind.GENERIC, {'text': 'Error: $exception'}); |
|
ahe
2013/08/06 15:01:00
Could you turn this into a non-generic message?
F
Johnni Winther
2013/08/19 08:05:19
Done.
|
| - throw new leg.CompilerCancelledException("$exception"); |
| - } |
| + return null; |
| } |
| SourceFile sourceFile = new SourceFile(resourceUri.toString(), text); |
| // We use [readableUri] as the URI for the script since need to preserve |
| @@ -220,34 +216,23 @@ class Compiler extends leg.Compiler { |
| } |
| } |
| if (!allowInternalLibraryAccess) { |
| - if (node != null && importingLibrary != null) { |
| + if (importingLibrary != null) { |
| reportError( |
| node, |
| - leg.MessageKind.GENERIC, |
| - {'text': |
| - 'Error: Internal library $resolvedUri is not accessible from ' |
| - '${importingLibrary.canonicalUri}.'}); |
| + leg.MessageKind.INTERNAL_LIBRARY_FROM, |
| + {'resolvedUri': resolvedUri, |
| + 'importingUri': importingLibrary.canonicalUri}); |
| } else { |
| reportError( |
| - null, |
| - leg.MessageKind.GENERIC, |
| - {'text': |
| - 'Error: Internal library $resolvedUri is not accessible.'}); |
| + node, |
| + leg.MessageKind.INTERNAL_LIBRARY, |
| + {'resolvedUri': resolvedUri}); |
| } |
| } |
| } |
| if (path == null) { |
| - if (node != null) { |
| - reportFatalError( |
| - node, |
| - leg.MessageKind.GENERIC, |
| - {'text': 'Error: Library not found ${resolvedUri}.'}); |
| - } else { |
| - reportFatalError( |
| - null, |
| - leg.MessageKind.GENERIC, |
| - {'text': 'Error: Library not found ${resolvedUri}.'}); |
| - } |
| + reportError(node, leg.MessageKind.LIBRARY_NOT_FOUND, |
| + {'resolvedUri': resolvedUri}); |
| return null; |
| } |
| if (resolvedUri.path == 'html' || |