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

Unified Diff: runtime/bin/main.cc

Issue 2193293002: Fail cleanly if we cannot open a file to write a snapshot. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 89c752b2815a24a3d8195c704feac4f029d67bf3..39314b2819497132d5bbaf37489a7287091932b5 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -1060,7 +1060,11 @@ static void WriteSnapshotFile(const char* snapshot_directory,
}
File* file = File::Open(qualified_filename, File::kWriteTruncate);
- ASSERT(file != NULL);
+ if (file == NULL) {
+ ErrorExit(kErrorExitCode,
+ "Unable to open file %s for writing snapshot\n",
+ qualified_filename);
+ }
if (write_magic_number) {
// Write the magic number to indicate file is a script snapshot.
@@ -1069,7 +1073,7 @@ static void WriteSnapshotFile(const char* snapshot_directory,
if (!file->WriteFully(buffer, size)) {
ErrorExit(kErrorExitCode,
- "Unable to open file %s for writing snapshot\n",
+ "Unable to write file %s for writing snapshot\n",
qualified_filename);
}
file->Release();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698