-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't stop for errors dumping invalid names or long names #375
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -238,8 +238,8 @@ void write_to_error_directory(const std::string& base, const std::string relpath | |
|
||
if (stream.fail() || stream.bad()) { | ||
std::cerr << "Error writing file to errors dir. " << (base + ERRORSDIR + url) << std::endl; | ||
throw std::runtime_error( | ||
std::string("Error writing file to errors dir. ") + (base + ERRORSDIR + url)); | ||
//throw std::runtime_error( | ||
std::string("Error writing file to errors dir. ") + (base + ERRORSDIR + url); | ||
} else { | ||
std::cerr << "Wrote " << (base + relpath) << " to " << (base + ERRORSDIR + url) << std::endl; | ||
} | ||
|
@@ -321,8 +321,8 @@ void ZimDumper::dumpFiles(const std::string& directory, bool symlinkdump, std::f | |
write_to_file(directory + SEPARATOR, relative_path, blob.data(), blob.size()); | ||
#else | ||
if (symlink(redirectPath.c_str(), full_path.c_str()) != 0) { | ||
throw std::runtime_error( | ||
std::string("Error creating symlink from ") + full_path + " to " + redirectPath); | ||
//throw std::runtime_error( | ||
std::string("Error creating symlink from ") + full_path + " to " + redirectPath; | ||
Comment on lines
+324
to
+325
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure about this one. |
||
} | ||
#endif | ||
} | ||
|
@@ -395,7 +395,7 @@ int subcmdDump(ZimDumper &app, std::map<std::string, docopt::value> &args) | |
std::string directory = args["--dir"].asString(); | ||
|
||
if (directory.empty()) { | ||
throw std::runtime_error("Directory cannot be empty."); | ||
//throw std::runtime_error("Directory cannot be empty."); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. This test is used to not overwrite a existing content in the output directory. |
||
} | ||
|
||
if (directory.back() == '/'){ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commenting the
throw std::runtime_error(
will just not throw the "error string".But the
std::string
is still created for nothing.Better remove the two lines.