mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Merge pull request #2015 from abarth/error_handling
Improve error handling in sky_snapshoter
This commit is contained in:
commit
8f7499f535
@ -10,6 +10,7 @@ group("sky") {
|
||||
"//sky/engine/wtf:unittests($host_toolchain)",
|
||||
"//sky/packages",
|
||||
"//sky/shell",
|
||||
"//sky/tools/sky_snapshot",
|
||||
]
|
||||
|
||||
if (is_android) {
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user