This repository has been archived on 2023-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
2017-06-22 20:58:31 +02:00
|
|
|
#ifndef __PLASP__TRANSLATOR_EXCEPTION_H
|
|
|
|
#define __PLASP__TRANSLATOR_EXCEPTION_H
|
2016-05-21 02:43:07 +02:00
|
|
|
|
|
|
|
#include <exception>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace plasp
|
|
|
|
{
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// TranslatorException
|
|
|
|
//
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
class TranslatorException: public std::exception
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit TranslatorException()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
explicit TranslatorException(const char *message)
|
|
|
|
: m_message(message)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
explicit TranslatorException(const std::string &message)
|
|
|
|
: m_message(message)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
~TranslatorException() throw()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *what() const throw()
|
|
|
|
{
|
|
|
|
if (m_message.empty())
|
2016-06-10 17:21:56 +02:00
|
|
|
return "Unspecified error while translating description";
|
2016-05-21 02:43:07 +02:00
|
|
|
|
|
|
|
return m_message.c_str();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::string m_message;
|
|
|
|
};
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|