diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-05-03 15:05:33 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-05-03 15:05:33 +0100 |
| commit | fe9bbdf3f5223ee94cb51ba00ddab7f4a6ddb754 (patch) | |
| tree | 1d7ff4b95d3a65989c3cb136ae338e59ca5251b1 /tools | |
| parent | 9f5a1507380c52338765477da7cbe378b68870d9 (diff) | |
Use exceptions to hold errors even in the keep_going case.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/dcpdiff.cc | 12 | ||||
| -rw-r--r-- | tools/dcpinfo.cc | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/tools/dcpdiff.cc b/tools/dcpdiff.cc index e4225ebc..666fc1b2 100644 --- a/tools/dcpdiff.cc +++ b/tools/dcpdiff.cc @@ -105,10 +105,10 @@ main (int argc, char* argv[]) DCP* a = 0; try { a = new DCP (argv[optind]); - list<string> errors; + list<shared_ptr<DCPReadError> > errors; a->read (keep_going, &errors); - for (list<string>::const_iterator i = errors.begin(); i != errors.end(); ++i) { - cerr << *i << "\n"; + for (list<shared_ptr<DCPReadError> >::const_iterator i = errors.begin(); i != errors.end(); ++i) { + cerr << (*i)->what() << "\n"; } } catch (FileError& e) { cerr << "Could not read DCP " << argv[optind] << "; " << e.what() << " " << e.filename() << "\n"; @@ -118,10 +118,10 @@ main (int argc, char* argv[]) DCP* b = 0; try { b = new DCP (argv[optind + 1]); - list<string> errors; + list<shared_ptr<DCPReadError> > errors; b->read (keep_going, &errors); - for (list<string>::const_iterator i = errors.begin(); i != errors.end(); ++i) { - cerr << *i << "\n"; + for (list<shared_ptr<DCPReadError> >::const_iterator i = errors.begin(); i != errors.end(); ++i) { + cerr << (*i)->what() << "\n"; } } catch (FileError& e) { cerr << "Could not read DCP " << argv[optind + 1] << "; " << e.what() << " " << e.filename() << "\n"; diff --git a/tools/dcpinfo.cc b/tools/dcpinfo.cc index c69de8a7..8f4c1b7d 100644 --- a/tools/dcpinfo.cc +++ b/tools/dcpinfo.cc @@ -148,7 +148,7 @@ main (int argc, char* argv[]) } DCP* dcp = 0; - list<string> errors; + list<shared_ptr<DCPReadError> > errors; try { dcp = new DCP (argv[optind]); dcp->read (keep_going, &errors); @@ -162,8 +162,8 @@ main (int argc, char* argv[]) cout << "DCP: " << boost::filesystem::path(argv[optind]).filename().string() << "\n"; - for (list<string>::const_iterator i = errors.begin(); i != errors.end(); ++i) { - cerr << "Error: " << *i << "\n"; + for (list<shared_ptr<DCPReadError> >::const_iterator i = errors.begin(); i != errors.end(); ++i) { + cerr << "Error: " << (*i)->what() << "\n"; } list<shared_ptr<CPL> > cpls = dcp->cpls (); |
