Added error handling
This commit is contained in:
@ -15,7 +15,7 @@ namespace fsh {
|
||||
virtual void run(std::istream& in, std::ostream& out, ArgManager& args) override {
|
||||
auto name = *(args.get<std::string>(0));
|
||||
if (std::ifstream(name, std::ios::in).good() || !std::ofstream(name, std::ios::out).is_open()) {
|
||||
throw std::runtime_error("File exists");
|
||||
throw util::FileExistsError();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user