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

Unified Diff: pkg/dev_compiler/lib/src/compiler/command.dart

Issue 2883443002: Better error when force-compile fails (Closed)
Patch Set: Created 3 years, 7 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/dev_compiler/lib/src/compiler/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/src/compiler/command.dart
diff --git a/pkg/dev_compiler/lib/src/compiler/command.dart b/pkg/dev_compiler/lib/src/compiler/command.dart
index cd340db8154888a41ab01eb7940eb3a228509f73..af34e95f711c3490304d9cd70cff1f4cfdcaa5f6 100644
--- a/pkg/dev_compiler/lib/src/compiler/command.dart
+++ b/pkg/dev_compiler/lib/src/compiler/command.dart
@@ -186,7 +186,11 @@ void _compile(ArgResults argResults, AnalyzerOptions analyzerOptions,
var module = compiler.compile(unit, compilerOpts);
module.errors.forEach(printFn);
- if (!module.isValid) throw new CompileErrorException();
+ if (!module.isValid) {
+ throw compilerOpts.unsafeForceCompile
+ ? new ForceCompileErrorException()
+ : new CompileErrorException();
+ }
// Write JS file, as well as source map and summary (if requested).
for (var i = 0; i < outPaths.length; i++) {
@@ -262,3 +266,9 @@ void _usageException(String message) {
class CompileErrorException implements Exception {
toString() => '\nPlease fix all errors before compiling (warnings are okay).';
}
+
+/// Thrown when force compilation failed (probably due to static errors).
+class ForceCompileErrorException extends CompileErrorException {
+ toString() =>
+ '\nForce-compilation not successful. Please check static errors.';
+}
« no previous file with comments | « no previous file | pkg/dev_compiler/lib/src/compiler/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698