1 #ifndef _HFST_EXCEPTION_DEFS_H_
2 #define _HFST_EXCEPTION_DEFS_H_
7 void hfst_set_exception(std::string name);
8 std::string hfst_get_exception();
21 HfstException(
const std::string &name,
const std::string &file,
size_t line);
28 #define HFST_THROW(E) do { \
29 hfst_set_exception(std::string(#E)); \
30 throw E(#E,__FILE__,__LINE__); } \
35 #define HFST_THROW_MESSAGE(E,M) do { \
36 hfst_set_exception(std::string(#E)); \
37 throw E(std::string(#E)+": "+std::string(M) \
38 ,__FILE__,__LINE__); } \
42 #define HFST_EXCEPTION_CHILD_DECLARATION(CHILD) \
43 struct CHILD : public HfstException \
44 { CHILD(const std::string &name,const std::string &file,size_t line); }
47 #define HFST_EXCEPTION_CHILD_DEFINITION(CHILD) \
49 (const std::string &name,const std::string &file,size_t line):\
50 HfstException(name,file,line)\
54 #define HFST_CATCH(E) \
57 std::cerr << e.file << ", line " << e.line << ": " << \
408 #endif // #ifndef _HFST_EXCEPTION_DEFS_H_
std::string operator()(void) const
Get the error message.
Definition: HfstExceptionDefs.cc:20
The stream does not contain transducers.
Definition: HfstExceptionDefs.h:195
The library required by the implementation type requested is not linked to HFST.
Definition: HfstExceptionDefs.h:80
String is not valid utf-8.
Definition: HfstExceptionDefs.h:395
Context transducers are not automata.
Definition: HfstExceptionDefs.h:278
State is not final (and cannot have a final weight).
Definition: HfstExceptionDefs.h:250
Base class for HfstExceptions. Holds its own name and the file and line number where it was thrown...
Definition: HfstExceptionDefs.h:15
Two or more transducers do not have the same type.
Definition: HfstExceptionDefs.h:347
The stream is at end.
Definition: HfstExceptionDefs.h:149
Two or more HfstTransducers are not of the same type.
Definition: HfstExceptionDefs.h:66
The StateId argument is not valid.
Definition: HfstExceptionDefs.h:304
The set of transducer pairs is empty.
Definition: HfstExceptionDefs.h:361
Transducers are not automata.
Definition: HfstExceptionDefs.h:291
Transducer is cyclic.
Definition: HfstExceptionDefs.h:168
An error happened probably due to a bug in the HFST code.
Definition: HfstExceptionDefs.h:378
Stream is closed.
Definition: HfstExceptionDefs.h:140
Stream cannot be read.
Definition: HfstExceptionDefs.h:100
#define HFST_EXCEPTION_CHILD_DECLARATION(CHILD)
Declare a subclass of HfstException of type CHILD.
Definition: HfstExceptionDefs.h:42
Stream cannot be written.
Definition: HfstExceptionDefs.h:118
Function has not been implemented (yet).
Definition: HfstExceptionDefs.h:83
Transducer has wrong type.
Definition: HfstExceptionDefs.h:388