nodejs-db-informix  master
nodejs bindings for Informix
 All Classes Functions Pages
exception.cxx
1 #include "exception.h"
2 
3 nodejs_db::Exception::Exception(const char* message) throw() : exception() {
4  this->setMessage(message);
5 }
6 
7 nodejs_db::Exception::Exception(const std::string& message) throw() : exception() {
8  this->setMessage(message.c_str());
9 }
10 
11 nodejs_db::Exception::~Exception() throw() {
12 }
13 
14 void nodejs_db::Exception::setMessage(const char* message) throw() {
15  this->message = message;
16 }
17 
18 const char* nodejs_db::Exception::what() const throw() {
19  return (!this->message.empty() ? this->message.c_str() : NULL);
20 }
21 
22 std::string::size_type nodejs_db::Exception::size() throw() {
23  return (!this->message.empty() ? this->message.size() : 0);
24 }