forked from mariano/node-db
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexception.cc
More file actions
25 lines (19 loc) · 714 Bytes
/
exception.cc
File metadata and controls
25 lines (19 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2011 Mariano Iglesias <mgiglesias@gmail.com>
#include "./exception.h"
node_db::Exception::Exception(const char* message) throw() : exception() {
this->setMessage(message);
}
node_db::Exception::Exception(const std::string& message) throw() : exception() {
this->setMessage(message.c_str());
}
node_db::Exception::~Exception() throw() {
}
void node_db::Exception::setMessage(const char* message) throw() {
this->message = message;
}
const char* node_db::Exception::what() const throw() {
return (!this->message.empty() ? this->message.c_str() : NULL);
}
std::string::size_type node_db::Exception::size() throw() {
return (!this->message.empty() ? this->message.size() : 0);
}