Output error message if file cannot be parsed by the analyzer.

This commit is contained in:
Moritz Bunkus 2010-01-28 09:29:33 +01:00
parent 834af40235
commit c58eb5b4a0
5 changed files with 15 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2010-01-28 Moritz Bunkus <moritz@bunkus.org>
* mkvextract: bug fix: Modes 'attachments', 'chapters', 'tags' and
'cuesheet': mkvextract will output an error message if the file
cannot be opened (e.g. because it does not exist or due to lack of
access).
2010-01-24 Moritz Bunkus <moritz@bunkus.org>
* mmg: enhancement: Changing the interface language does not

View File

@ -113,7 +113,8 @@ extract_attachments(const std::string &file_name,
// open input file
try {
analyzer = kax_analyzer_cptr(new kax_analyzer_c(file_name));
analyzer->process(parse_mode);
if (!analyzer->process(parse_mode))
throw false;
} catch (...) {
show_error(boost::format(Y("The file '%1%' could not be opened for reading (%2%).")) % file_name % strerror(errno));
return;

View File

@ -46,7 +46,8 @@ extract_chapters(const std::string &file_name,
// open input file
try {
analyzer = kax_analyzer_cptr(new kax_analyzer_c(file_name));
analyzer->process(parse_mode);
if (!analyzer->process(parse_mode))
throw false;
} catch (...) {
show_error(boost::format(Y("The file '%1%' could not be opened for reading (%2%).")) % file_name % strerror(errno));
return;

View File

@ -203,7 +203,8 @@ extract_cuesheet(const std::string &file_name,
// open input file
try {
analyzer = kax_analyzer_cptr(new kax_analyzer_c(file_name));
analyzer->process(parse_mode);
if (!analyzer->process(parse_mode))
throw false;
} catch (...) {
show_error(boost::format(Y("The file '%1%' could not be opened for reading (%2%).")) % file_name % strerror(errno));
return;

View File

@ -46,7 +46,8 @@ extract_tags(const std::string &file_name,
// open input file
try {
analyzer = kax_analyzer_cptr(new kax_analyzer_c(file_name));
analyzer->process(parse_mode);
if (!analyzer->process(parse_mode))
throw false;
} catch (...) {
show_error(boost::format(Y("The file '%1%' could not be opened for reading (%2%).")) % file_name % strerror(errno));
return;