summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdbpp/selectcommand.cpp13
-rw-r--r--libdbpp/selectcommand.h7
2 files changed, 18 insertions, 2 deletions
diff --git a/libdbpp/selectcommand.cpp b/libdbpp/selectcommand.cpp
index 792af12..d904b35 100644
--- a/libdbpp/selectcommand.cpp
+++ b/libdbpp/selectcommand.cpp
@@ -2,11 +2,24 @@
#include "error.h"
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/ordered_index.hpp>
+#include <buffer.h>
namespace DB {
ColumnIndexOutOfRange::ColumnIndexOutOfRange(unsigned int n) : colNo(n) { }
+ std::string
+ ColumnIndexOutOfRange::message() const throw()
+ {
+ return stringf("Column (%u) index out of range", colNo);
+ }
+
ColumnDoesNotExist::ColumnDoesNotExist(const Glib::ustring & n) : colName(n) { }
+
+ std::string
+ ColumnDoesNotExist::message() const throw()
+ {
+ return stringf("Column (%s) does not exist", colName.c_str());
+ }
};
DB::SelectCommand::SelectCommand(const std::string & sql) :
diff --git a/libdbpp/selectcommand.h b/libdbpp/selectcommand.h
index 8c9af13..e82a532 100644
--- a/libdbpp/selectcommand.h
+++ b/libdbpp/selectcommand.h
@@ -11,18 +11,21 @@
#include <boost/function/function_fwd.hpp>
#include <boost/shared_ptr.hpp>
#include <visibility.h>
+#include <exception.h>
namespace DB {
class Column;
- class ColumnIndexOutOfRange : public Error {
+ class DLL_PUBLIC ColumnIndexOutOfRange : public AdHoc::Exception<Error> {
public:
ColumnIndexOutOfRange(unsigned int n);
+ std::string message() const throw() override;
const unsigned int colNo;
};
- class ColumnDoesNotExist : public Error {
+ class DLL_PUBLIC ColumnDoesNotExist : public AdHoc::Exception<Error> {
public:
ColumnDoesNotExist(const Glib::ustring & n);
+ std::string message() const throw() override;
const Glib::ustring colName;
};