Show error message if output file is not writable (#779)
This commit is contained in:
1 parent
2ed596c87a
commit
67ebba6f22
1 file changed
+6
-1
@@ -351,7 +351,12 @@ int main(int argc, char *argv[]) {
|
||||
outputName = getFileNameFromPath(fileNameNoExt(FLAGS_m)) + ".blob";
|
||||
}
|
||||
std::ofstream outputFile{outputName};
|
||||
executableNetwork.Export(outputFile);
|
||||
if (!outputFile) {
|
||||
std::cout << "Output file " << outputName << " can't be opened for writing" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
} else {
|
||||
executableNetwork.Export(outputFile);
|
||||
}
|
||||
} catch (const std::exception &error) {
|
||||
std::cerr << error.what() << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
|
||||
Reference in new issue
Block a user