2010-10-27 21:50:40 +04:00
|
|
|
#ifndef LM_LM_EXCEPTION__
|
|
|
|
#define LM_LM_EXCEPTION__
|
|
|
|
|
|
|
|
// Named to avoid conflict with util/exception.hh.
|
2010-09-10 04:36:07 +04:00
|
|
|
|
2010-09-28 20:26:55 +04:00
|
|
|
#include "util/exception.hh"
|
|
|
|
#include "util/string_piece.hh"
|
2010-09-10 04:36:07 +04:00
|
|
|
|
|
|
|
#include <exception>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace lm {
|
|
|
|
|
2011-05-23 06:23:01 +04:00
|
|
|
typedef enum {THROW_UP, COMPLAIN, SILENT} WarningAction;
|
2011-05-17 20:43:05 +04:00
|
|
|
|
2010-12-08 06:15:37 +03:00
|
|
|
class ConfigException : public util::Exception {
|
|
|
|
public:
|
|
|
|
ConfigException() throw();
|
|
|
|
~ConfigException() throw();
|
|
|
|
};
|
|
|
|
|
2010-09-15 01:33:11 +04:00
|
|
|
class LoadException : public util::Exception {
|
2010-09-10 04:36:07 +04:00
|
|
|
public:
|
2010-09-15 01:33:11 +04:00
|
|
|
virtual ~LoadException() throw();
|
2010-09-10 04:36:07 +04:00
|
|
|
|
|
|
|
protected:
|
2010-09-15 01:33:11 +04:00
|
|
|
LoadException() throw();
|
2010-09-10 04:36:07 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
class FormatLoadException : public LoadException {
|
|
|
|
public:
|
2010-09-15 01:33:11 +04:00
|
|
|
FormatLoadException() throw();
|
|
|
|
~FormatLoadException() throw();
|
2010-09-10 04:36:07 +04:00
|
|
|
};
|
|
|
|
|
2010-12-08 06:15:37 +03:00
|
|
|
class VocabLoadException : public LoadException {
|
|
|
|
public:
|
|
|
|
virtual ~VocabLoadException() throw();
|
|
|
|
VocabLoadException() throw();
|
|
|
|
};
|
|
|
|
|
2010-09-15 01:33:11 +04:00
|
|
|
class SpecialWordMissingException : public VocabLoadException {
|
2010-09-10 04:36:07 +04:00
|
|
|
public:
|
2011-02-24 22:37:39 +03:00
|
|
|
explicit SpecialWordMissingException() throw();
|
2010-09-15 01:33:11 +04:00
|
|
|
~SpecialWordMissingException() throw();
|
2010-09-10 04:36:07 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace lm
|
|
|
|
|
2011-05-23 06:23:01 +04:00
|
|
|
#endif // LM_LM_EXCEPTION
|