summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-01-16 22:38:44 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2015-06-13 17:29:46 +0100
commitb38b845f49135217295b06f4c6e1f94c7175dac5 (patch)
treebf93c6cba6f64baebd5b700ea8bec7e41c434de7
parentDB layer reports length in bytes, not chars (diff)
downloadp2pvr-b38b845f49135217295b06f4c6e1f94c7175dac5.tar.bz2
p2pvr-b38b845f49135217295b06f4c6e1f94c7175dac5.tar.xz
p2pvr-b38b845f49135217295b06f4c6e1f94c7175dac5.zip
Actually throw the exceptions in deserialize object and tidy up the select
-rw-r--r--p2pvr/daemon/sqlSelectDeserializer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/p2pvr/daemon/sqlSelectDeserializer.cpp b/p2pvr/daemon/sqlSelectDeserializer.cpp
index 71e320d..8217f1e 100644
--- a/p2pvr/daemon/sqlSelectDeserializer.cpp
+++ b/p2pvr/daemon/sqlSelectDeserializer.cpp
@@ -132,11 +132,12 @@ void
SqlSelectDeserializer::DeserializeObject(Slicer::ModelPartPtr mp)
{
if (!cmd.fetch()) {
- std::invalid_argument("No rows returned");
+ throw std::invalid_argument("No rows returned");
}
DeserializeRow(mp);
if (cmd.fetch()) {
- std::invalid_argument("Too many rows returned");
+ while (cmd.fetch()) ;
+ throw std::invalid_argument("Too many rows returned");
}
}