Index: tools/observatory_tool.py |
diff --git a/tools/observatory_tool.py b/tools/observatory_tool.py |
index 5936b8220517fe4c9c8da69a42d5724d44b3dec2..57b3a067cf41683123224a40bc25ecbb596339c9 100755 |
--- a/tools/observatory_tool.py |
+++ b/tools/observatory_tool.py |
@@ -39,6 +39,31 @@ IGNORE_PATTERNS = shutil.ignore_patterns( |
usage = """observatory_tool.py [options]""" |
+def DisplayBootstrapWarning(): |
+ print """\ |
+ |
+WARNING: Your system cannot run the checked-in Dart SDK. Using the |
+bootstrap Dart executable will make debug builds slow. |
+Please see the Wiki for instructions on replacing the checked-in Dart SDK. |
+ |
+https://github.com/dart-lang/sdk/wiki/The-checked-in-SDK-in-tools |
+ |
+To use the dart_bootstrap binary please update the PubCommand function |
+in the tools/observatory_tool.py script. |
+ |
+""" |
+ |
+def DisplayFailureMessage(): |
+ print """\ |
+ |
+ERROR: Observatory failed to build. What should you do? |
+ |
+1. Revert to a working revision of the Dart VM |
+2. Contact zra@, johnmccutchan@, dart-vm-team@ |
+3. File a bug: https://github.com/dart-lang/sdk/issues/new |
+ |
+""" |
+ |
# Run |command|. If its return code is 0, return 0 and swallow its output. |
# If its return code is non-zero, emit its output unless |always_silent| is |
# True, and return the return code. |
@@ -60,6 +85,7 @@ def RunCommand(command, always_silent=False): |
if not always_silent: |
print ("Command failed: " + ' '.join(command) + "\n" + |
"output: " + e.output) |
+ DisplayFailureMessage() |
return e.returncode |
def CreateTimestampFile(options): |
@@ -138,21 +164,6 @@ def ProcessOptions(options, args): |
def ChangeDirectory(directory): |
os.chdir(directory); |
-def DisplayBootstrapWarning(): |
- print """\ |
- |
- |
-WARNING: Your system cannot run the checked-in Dart SDK. Using the |
-bootstrap Dart executable will make debug builds slow. |
-Please see the Wiki for instructions on replacing the checked-in Dart SDK. |
- |
-https://github.com/dart-lang/sdk/wiki/The-checked-in-SDK-in-tools |
- |
-To use the dart_bootstrap binary please update the PubCommand function |
-in the tools/observatory_tool.py script. |
- |
-""" |
- |
def PubCommand(dart_executable, |
pub_executable, |
pub_snapshot, |
@@ -242,12 +253,15 @@ def main(): |
options.stamp = os.path.abspath(options.stamp) |
if len(args) == 1: |
args[0] = os.path.abspath(args[0]) |
- # Pub must be run from the project's root directory. |
- ChangeDirectory(options.directory) |
- result = ExecuteCommand(options, args) |
- if result == 0: |
- CreateTimestampFile(options) |
- return result |
+ try: |
+ # Pub must be run from the project's root directory. |
+ ChangeDirectory(options.directory) |
+ result = ExecuteCommand(options, args) |
+ if result == 0: |
+ CreateTimestampFile(options) |
+ return result |
+ except: |
+ DisplayFailureMessage() |
if __name__ == '__main__': |