class BucketDeserializationException : public DatabaseException {
public:
BucketDeserializationException(const PolicyBucketId &bucketId) : m_bucketId(bucketId) {}
- ~BucketDeserializationException() noexcept {};
+ virtual ~BucketDeserializationException() {};
const std::string message(void) const {
if (m_message.empty()) {
public:
BucketNotExistsException() = delete;
BucketNotExistsException(const PolicyBucketId &bucketId) : m_bucketId(bucketId) {}
- virtual ~BucketNotExistsException() noexcept {};
+ virtual ~BucketNotExistsException() {};
virtual const std::string message(void) const {
return "BucketNotExistsException";
}
-private:
- PolicyBucketId m_bucketId;
-
-public:
- const PolicyBucketId &bucketId() const {
+ const PolicyBucketId &bucketId(void) const {
return m_bucketId;
}
+
+private:
+ PolicyBucketId m_bucketId;
};
} /* namespace Cynara */
class BucketRecordCorruptedException : public DatabaseException {
public:
BucketRecordCorruptedException(void) = delete;
- virtual ~BucketRecordCorruptedException() noexcept {};
+ virtual ~BucketRecordCorruptedException() {};
BucketRecordCorruptedException(const std::string &line)
: m_lineNumber(0), m_line(line) {}
return m_whatMsg;
}
+ const std::string &filename(void) const {
+ return m_filename;
+ }
+
+ const std::string &line(void) const {
+ return m_line;
+ }
+
+ size_t lineNumber(void) const {
+ return m_lineNumber;
+ }
+
protected:
inline std::string slicedLine(void) const {
return m_line.substr(0, 50) + (m_line.size() > 50 ? "..." : "");
std::string m_line;
std::string m_filename;
mutable std::string m_whatMsg;
-
-public:
- const std::string &filename(void) const {
- return m_filename;
- }
-
- const std::string &line(void) const {
- return m_line;
- }
-
- size_t lineNumber(void) const {
- return m_lineNumber;
- }
};
} /* namespace Cynara */
class BucketSerializationException : public DatabaseException {
public:
BucketSerializationException(const PolicyBucketId &bucketId) : m_bucketId(bucketId) {}
- ~BucketSerializationException() noexcept {};
+ virtual ~BucketSerializationException() {};
const std::string message(void) const {
if (m_message.empty()) {
class CannotCreateFileException : public DatabaseException {
public:
CannotCreateFileException(const std::string &filename) : m_filename(filename) {};
- virtual ~CannotCreateFileException() noexcept {};
+ virtual ~CannotCreateFileException() {};
const std::string message(void) const {
if (m_message.empty()) {
namespace Cynara {
class DatabaseException : public Exception {
-
+public:
+ virtual ~DatabaseException() {};
};
} /* namespace Cynara */
class DefaultBucketDeletionException : public Exception {
public:
DefaultBucketDeletionException() = default;
- virtual ~DefaultBucketDeletionException() noexcept {};
+ virtual ~DefaultBucketDeletionException() {};
virtual const std::string message(void) const {
return "DefaultBucketDeletionException";
class DefaultBucketSetNoneException : public Exception {
public:
DefaultBucketSetNoneException() = default;
- virtual ~DefaultBucketSetNoneException() noexcept {};
+ virtual ~DefaultBucketSetNoneException() {};
virtual const std::string message(void) const {
return "DefaultBucketSetNoneException";
namespace Cynara {
class DescriptorNotExistsException : public Exception {
-private:
- std::string m_whatMsg;
-
public:
DescriptorNotExistsException() = delete;
DescriptorNotExistsException(int desc) {
m_whatMsg = stream.str();
}
- virtual ~DescriptorNotExistsException() noexcept {};
+ virtual ~DescriptorNotExistsException() {};
virtual const std::string message(void) const {
return m_whatMsg;
}
+
+private:
+ std::string m_whatMsg;
};
} // namespace Cynara
m_backtrace = Backtrace::getBacktrace();
}
- virtual ~Exception() noexcept {};
+ virtual ~Exception() {};
virtual const char *what(void) const noexcept {
if(m_whatMessage.empty()) {
- m_whatMessage = message() + " From: " + m_backtrace;
+ try {
+ m_whatMessage = message() + " From: " + m_backtrace;
+ }
+ catch (...) {
+ }
}
return m_whatMessage.c_str();
}
class FileNotFoundException : public DatabaseException {
public:
FileNotFoundException(const std::string &filename) : m_filename(filename) {};
- virtual ~FileNotFoundException() noexcept {};
+ virtual ~FileNotFoundException() {};
const std::string message(void) const {
if (m_message.empty()) {
class InitException : public Exception {
public:
InitException() = default;
- virtual ~InitException() noexcept {};
+ virtual ~InitException() {};
virtual const std::string message(void) const {
return "InitException";
Other
};
-private:
- std::string m_whatMessage;
- ExceptionType m_exceptionType;
-
-public:
InvalidProtocolException(ExceptionType exceptionType) :
m_exceptionType(exceptionType) {
switch(m_exceptionType) {
m_whatMessage = "Unknown problem";
break;
}
-
}
- virtual ~InvalidProtocolException() noexcept {};
+ virtual ~InvalidProtocolException() {};
virtual const std::string message(void) const {
return m_whatMessage;
}
- ExceptionType exceptionTyp(void) const {
+ ExceptionType exceptionType(void) const {
return m_exceptionType;
}
+
+private:
+ std::string m_whatMessage;
+ ExceptionType m_exceptionType;
};
} // namespace Cynara
m_whatMessage = "NoMemoryException with message <" + errorMsg + ">";
}
- virtual ~NoMemoryException() noexcept {};
+ virtual ~NoMemoryException() {};
virtual const std::string message(void) const {
return m_whatMessage;
class NotImplementedException : public Exception {
public:
NotImplementedException() = default;
- virtual ~NotImplementedException() noexcept {};
+ virtual ~NotImplementedException() {};
virtual const std::string message(void) const {
return "NotImplementedException";
* @file src/common/exceptions/NullPointerException.h
* @author Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
* @version 1.0
- * @brief Implementation of OutOfDataException
+ * @brief Implementation of NullPointerException
*/
#ifndef SRC_COMMON_EXCEPTIONS_NULLPOINTEREXCEPTION_H_
namespace Cynara {
class NullPointerException : public Exception {
-private:
- std::string m_whatMsg;
-
public:
NullPointerException() = delete;
NullPointerException(const char *varName) {
+ std::string(">");
}
- virtual ~NullPointerException() noexcept {};
+ virtual ~NullPointerException() {};
virtual const std::string message(void) const {
return m_whatMsg;
}
+
+private:
+ std::string m_whatMsg;
};
} // namespace Cynara
namespace Cynara {
class OutOfDataException : public Exception {
-private:
- std::string m_whatMsg;
-
public:
OutOfDataException() = delete;
OutOfDataException(size_t dataRange, size_t accessTry) {
m_whatMsg = stream.str();
}
- virtual ~OutOfDataException() noexcept {};
+ virtual ~OutOfDataException() {};
virtual const std::string message(void) const {
return m_whatMsg;
}
+
+private:
+ std::string m_whatMsg;
};
} // namespace Cynara
namespace Cynara {
class PluginNotFoundException : public Exception {
-private:
- std::string m_whatMessage;
-
public:
PluginNotFoundException() = delete;
PluginNotFoundException(const PolicyResult &result) {
m_whatMessage = stream.str();
}
- virtual ~PluginNotFoundException() noexcept {};
+ virtual ~PluginNotFoundException() {};
virtual const std::string message(void) const {
return m_whatMessage;
}
+
+private:
+ std::string m_whatMessage;
};
} // namespace Cynara
namespace Cynara {
class UnexpectedErrorException : public Exception {
-private:
- std::string m_whatMessage;
-
public:
UnexpectedErrorException() = delete;
UnexpectedErrorException(int errorCode, const char *errorMsg) {
m_whatMessage = stream.str();
}
- virtual ~UnexpectedErrorException() noexcept {};
+ virtual ~UnexpectedErrorException() {};
virtual const std::string message(void) const {
return m_whatMessage;
}
+
+private:
+ std::string m_whatMessage;
};
} // namespace Cynara