From: Date: October 24 2007 8:40pm Subject: Patch for better exception use -- BadQuery w/Errnum patch part 1 List-Archive: http://lists.mysql.com/plusplus/7120 Message-Id: <5AA52B773286DA4E83B1F2D034FFED3763BDDF@mailexchange.klausatlanta.local> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- exceptions.h (revision 1779) +++ exceptions.h (working copy) @@ -235,6 +235,19 @@ }; =20 =20 +/// \brief Exception thrown no result set was returned in a fetch,=20 +/// usually due to an error. + +class MYSQLPP_EXPORT UseQueryError : public Exception +{ +public: + /// \brief Create exception object + explicit UseQueryError(const char* w =3D "") : + Exception(w) + { + } +}; +