10 #ifndef _HFST_EXCEPTION_DEFS_H_
11 #define _HFST_EXCEPTION_DEFS_H_
16 void hfst_set_exception(std::string name);
17 std::string hfst_get_exception();
32 HfstException(
const std::string &name,
const std::string &file,
size_t line);
40 #define HFST_THROW(E) do { \
41 hfst_set_exception(std::string(#E)); \
42 throw E(#E,__FILE__,__LINE__); } \
47 #define HFST_THROW_MESSAGE(E,M) do { \
48 hfst_set_exception(std::string(#E)); \
49 throw E(std::string(#E)+": "+std::string(M) \
50 ,__FILE__,__LINE__); } \
54 #define HFST_EXCEPTION_CHILD_DECLARATION(CHILD) \
55 struct CHILD : public HfstException \
56 { CHILD(const std::string &name,const std::string &file,size_t line); }
59 #define HFST_EXCEPTION_CHILD_DEFINITION(CHILD) \
61 (const std::string &name,const std::string &file,size_t line):\
62 HfstException(name,file,line)\
66 #define HFST_CATCH(E) \
69 std::cerr << e.file << ", line " << e.line << ": " << \
422 #endif // #ifndef _HFST_EXCEPTION_DEFS_H_
HFSTDLL std::string operator()(void) const
Get the error message.
Definition: HfstExceptionDefs.cc:31
The stream does not contain transducers.
Definition: HfstExceptionDefs.h:207
The library required by the implementation type requested is not linked to HFST.
Definition: HfstExceptionDefs.h:92
String is not valid utf-8.
Definition: HfstExceptionDefs.h:407
Context transducers are not automata.
Definition: HfstExceptionDefs.h:290
State is not final (and cannot have a final weight).
Definition: HfstExceptionDefs.h:262
Base class for HfstExceptions. Holds its own name and the file and line number where it was thrown...
Definition: HfstExceptionDefs.h:26
Two or more transducers do not have the same type.
Definition: HfstExceptionDefs.h:359
The stream is at end.
Definition: HfstExceptionDefs.h:161
Two or more HfstTransducers are not of the same type.
Definition: HfstExceptionDefs.h:78
The StateId argument is not valid.
Definition: HfstExceptionDefs.h:316
The set of transducer pairs is empty.
Definition: HfstExceptionDefs.h:373
Transducers are not automata.
Definition: HfstExceptionDefs.h:303
Transducer is cyclic.
Definition: HfstExceptionDefs.h:180
An error happened probably due to a bug in the HFST code.
Definition: HfstExceptionDefs.h:390
Stream is closed.
Definition: HfstExceptionDefs.h:152
Stream cannot be read.
Definition: HfstExceptionDefs.h:112
#define HFST_EXCEPTION_CHILD_DECLARATION(CHILD)
Declare a subclass of HfstException of type CHILD.
Definition: HfstExceptionDefs.h:54
Stream cannot be written.
Definition: HfstExceptionDefs.h:130
Function has not been implemented (yet).
Definition: HfstExceptionDefs.h:95
Transducer has wrong type.
Definition: HfstExceptionDefs.h:400