Merge pull request #2015 from abarth/error_handling

Improve error handling in sky_snapshoter
This commit is contained in:
Collin Jackson 2015-11-09 12:23:55 -08:00
commit 8f7499f535
3 changed files with 7 additions and 3 deletions

View File

@ -10,6 +10,7 @@ group("sky") {
"//sky/engine/wtf:unittests($host_toolchain)",
"//sky/packages",
"//sky/shell",
"//sky/tools/sky_snapshot",
]
if (is_android) {

View File

@ -18,7 +18,10 @@ namespace {
std::string Fetch(const std::string& url) {
base::FilePath path(url);
std::string source;
CHECK(base::ReadFileToString(path, &source)) << url;
if (!base::ReadFileToString(path, &source)) {
fprintf(stderr, "error: Unable to find Dart library '%s'.\n", url.c_str());
exit(1);
}
return source;
}

View File

@ -19,9 +19,9 @@
#include "sky/tools/sky_snapshot/vm.h"
void Usage() {
std::cerr << "Usage: sky_packager"
std::cerr << "Usage: sky_snapshot"
<< " --" << switches::kPackageRoot << " --" << switches::kSnapshot
<< " <sky-app>" << std::endl;
<< " <lib/main.dart>" << std::endl;
}
void WriteSnapshot(base::FilePath path) {