diff options
Diffstat (limited to 'slicer/db')
-rw-r--r-- | slicer/db/sqlCommon.cpp | 27 | ||||
-rw-r--r-- | slicer/db/sqlExceptions.ice | 4 |
2 files changed, 31 insertions, 0 deletions
diff --git a/slicer/db/sqlCommon.cpp b/slicer/db/sqlCommon.cpp new file mode 100644 index 0000000..645c10f --- /dev/null +++ b/slicer/db/sqlCommon.cpp @@ -0,0 +1,27 @@ +#include <sqlExceptions.h> +#include <boost/format.hpp> + +namespace Slicer { + void TooManyRowsReturned::ice_print(std::ostream & s) const + { + s << "Too many rows returned"; + } + + void NoRowsReturned::ice_print(std::ostream & s) const + { + s << "No rows returned"; + } + + void NoRowsFound::ice_print(std::ostream & s) const + { + s << "No rows found"; + } + + void UnsuitableIdFieldType::ice_print(std::ostream & s) const + { + static boost::format f("Unsuitable id field type [%s]"); + s << f % type; + } + +} + diff --git a/slicer/db/sqlExceptions.ice b/slicer/db/sqlExceptions.ice index a392876..3aca6a2 100644 --- a/slicer/db/sqlExceptions.ice +++ b/slicer/db/sqlExceptions.ice @@ -4,9 +4,13 @@ #include <common.ice> module Slicer { + ["cpp:ice_print"] exception TooManyRowsReturned extends DeserializerError {}; + ["cpp:ice_print"] exception NoRowsReturned extends DeserializerError {}; + ["cpp:ice_print"] exception NoRowsFound extends SerializerError {}; + ["cpp:ice_print"] exception UnsuitableIdFieldType extends SerializerError { string type; }; |