From 95a9597217e3156b71a5ea8c203b1e5e78e0dd1b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 8 Nov 2015 02:00:00 +0000 Subject: Expose exceptions --- libdbpp/selectcommand.cpp | 13 ++----------- libdbpp/selectcommand.h | 13 +++++++++++++ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/libdbpp/selectcommand.cpp b/libdbpp/selectcommand.cpp index 7e72ee5..792af12 100644 --- a/libdbpp/selectcommand.cpp +++ b/libdbpp/selectcommand.cpp @@ -4,18 +4,9 @@ #include namespace DB { - class ColumnIndexOutOfRange : public Error { - public: - ColumnIndexOutOfRange(unsigned int n) : colNo(n) { } + ColumnIndexOutOfRange::ColumnIndexOutOfRange(unsigned int n) : colNo(n) { } - const unsigned int colNo; - }; - class ColumnDoesNotExist : public Error { - public: - ColumnDoesNotExist(const Glib::ustring & n) : colName(n) { } - - const Glib::ustring colName; - }; + ColumnDoesNotExist::ColumnDoesNotExist(const Glib::ustring & n) : colName(n) { } }; DB::SelectCommand::SelectCommand(const std::string & sql) : diff --git a/libdbpp/selectcommand.h b/libdbpp/selectcommand.h index 1586357..8c9af13 100644 --- a/libdbpp/selectcommand.h +++ b/libdbpp/selectcommand.h @@ -3,6 +3,7 @@ #include "command.h" #include "column.h" +#include "error.h" #include #include #include @@ -13,6 +14,18 @@ namespace DB { class Column; + class ColumnIndexOutOfRange : public Error { + public: + ColumnIndexOutOfRange(unsigned int n); + + const unsigned int colNo; + }; + class ColumnDoesNotExist : public Error { + public: + ColumnDoesNotExist(const Glib::ustring & n); + + const Glib::ustring colName; + }; /// Represents a command expected to return data to the client. class DLL_PUBLIC SelectCommand : public virtual Command { public: -- cgit v1.2.3