diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-11 13:30:25 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-11 13:30:25 +0200 |
commit | db6f5f55f1f0130bba814c494001cbadb138f53f (patch) | |
tree | f2206b2f46dcd56a692ce003671c6e33c3eda7a5 /build/b.cxx | |
parent | a7362cf29a76ef679c9a1ce74715a5d087851b91 (diff) |
Handle file io failures in parser
Diffstat (limited to 'build/b.cxx')
-rw-r--r-- | build/b.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/build/b.cxx b/build/b.cxx index 665fac8..8ea9094 100644 --- a/build/b.cxx +++ b/build/b.cxx @@ -186,17 +186,17 @@ main (int argc, char* argv[]) s += ' '; } - istringstream is (s); - is.exceptions (istringstream::failbit | istringstream::badbit); - parser p; - try { + istringstream is (s); + is.exceptions (istringstream::failbit | istringstream::badbit); + + parser p; bspec = p.parse_buildspec (is, "<buildspec>"); } - catch (const std::ios_base::failure&) + catch (const istringstream::failure&) { - fail << "failed to parse buildspec string"; + fail << "unable to parse buildspec '" << s << "'"; } } |