Part 1 of broken up new version of BadQuery update patches after review
by Warren.
In this case the BadQuery was being misused in this case and Warren
suggested a new exception.
See http://lists.mysql.com/plusplus/7060 for reference
Diffs are from the current svn
Index: result.h
===================================================================
--- result.h (revision 1779)
+++ result.h (working copy)
@@ -105,7 +105,7 @@
{
if (!result_) {
if (throw_exceptions()) {
- throw BadQuery("Results not fetched");
+ throw UseQueryError("Results not
fetched");
}
else {
return Row();
Index: exceptions.h
===================================================================
--- exceptions.h (revision 1779)
+++ exceptions.h (working copy)
@@ -235,6 +235,19 @@
};
+/// \brief Exception thrown no result set was returned in a fetch,
+/// usually due to an error.
+
+class MYSQLPP_EXPORT UseQueryError : public Exception
+{
+public:
+ /// \brief Create exception object
+ explicit UseQueryError(const char* w = "") :
+ Exception(w)
+ {
+ }
+};
+