aboutsummaryrefslogtreecommitdiff
path: root/odb/plugin.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-09-19 16:47:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-09-19 16:47:07 +0200
commitb7335b8c1425138601698f2deac8e471b371cbcc (patch)
tree44b882d839540d14bfc7f754aca8344301212342 /odb/plugin.cxx
parent8fc4fda0ce88fccbe40c36be3925237a4bca36d9 (diff)
Throw exception instead of returning false to indicate validation failure
This is consistent with what's done in processor and generator.
Diffstat (limited to 'odb/plugin.cxx')
-rw-r--r--odb/plugin.cxx34
1 files changed, 13 insertions, 21 deletions
diff --git a/odb/plugin.cxx b/odb/plugin.cxx
index 7f01478..fbf1fa0 100644
--- a/odb/plugin.cxx
+++ b/odb/plugin.cxx
@@ -112,36 +112,22 @@ gate_callback (void*, void*)
// Validate, pass 1.
//
- {
- validator v;
- if (!v.validate (*options_, *u, file_, 1))
- r = 1;
- }
+ validator v;
+ v.validate (*options_, *u, file_, 1);
// Process.
//
- if (r == 0)
- {
- processor p;
- p.process (*options_, *u, file_);
- }
+ processor pr;
+ pr.process (*options_, *u, file_);
// Validate, pass 2.
//
- if (r == 0)
- {
- validator v;
- if (!v.validate (*options_, *u, file_, 2))
- r = 1;
- }
+ v.validate (*options_, *u, file_, 2);
// Generate.
//
- if (r == 0)
- {
- generator g;
- g.generate (*options_, *u, file_);
- }
+ generator g;
+ g.generate (*options_, *u, file_);
}
catch (parser::failed const&)
{
@@ -149,6 +135,12 @@ gate_callback (void*, void*)
//
r = 1;
}
+ catch (validator::failed const&)
+ {
+ // Diagnostics has aready been issued.
+ //
+ r = 1;
+ }
catch (processor::failed const&)
{
// Diagnostics has aready been issued.