OpenTREP Logo  0.07.4
C++ Open Travel Request Parsing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OPENTREP_exceptions.hpp
Go to the documentation of this file.
1 #ifndef __OPENTREP_OPENTREP_EXCEPTIONS_HPP
2 #define __OPENTREP_OPENTREP_EXCEPTIONS_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <exception>
9 
10 namespace OPENTREP {
11 
12  // ///////// Exceptions ///////////
20  class RootException : public std::exception {
21  public:
25  RootException (const std::string& iWhat) : _what (iWhat) {}
29  RootException() : _what ("No further details") {}
30 
34  virtual ~RootException() throw() {}
35 
39  const char* what() const throw() {
40  return _what.c_str();
41  }
42 
43  protected:
47  std::string _what;
48  };
49 
54  public:
58  NonInitialisedServiceException (const std::string& iWhat)
59  : RootException (iWhat) {}
60  };
61 
66  public:
70  UnicodeException (const std::string& iWhat) : RootException (iWhat) {}
71  };
72 
77  public:
81  UnicodeTransliteratorCreationException (const std::string& iWhat)
82  : UnicodeException (iWhat) {}
83  };
84 
89  public:
93  MultipleRowsForASingleDocIDException (const std::string& iWhat)
94  : RootException (iWhat) {}
95  };
96 
101  public:
106  : RootException (iWhat) {}
107  };
108 
113  public:
117  MemoryAllocationException (const std::string& iWhat) : RootException (iWhat) {}
118  };
119 
124  public:
128  ObjectNotFoundException (const std::string& iWhat) : RootException (iWhat) {}
129  };
130 
134  class FileException : public RootException {
135  public:
139  FileException (const std::string& iWhat) : RootException (iWhat) {}
140  };
141 
146  public:
150  FileNotFoundException (const std::string& iWhat) : FileException (iWhat) {}
151  };
152 
157  public:
161  FileExtensionUnknownException (const std::string& iWhat)
162  : FileException (iWhat) {}
163  };
164 
169  public:
173  FileUncompressingErrorException (const std::string& iWhat)
174  : FileException (iWhat) {}
175  };
176 
180  class ParserException : public RootException {
181  public:
185  ParserException (const std::string& iWhat) : RootException (iWhat) {}
186  };
187 
192  public:
196  PorFileParsingException (const std::string& iWhat)
197  : ParserException (iWhat) {}
198  };
199 
204  public:
208  PRFileParsingException (const std::string& iWhat)
209  : ParserException (iWhat) {}
210  };
211 
216  public:
220  CodeConversionException (const std::string& iWhat)
221  : ParserException (iWhat) {}
222  };
223 
228  public:
232  CodeDuplicationException (const std::string& iWhat)
233  : ParserException (iWhat) {}
234  };
235 
240  public:
244  XapianException (const std::string& iWhat) : RootException (iWhat) {}
245  };
246 
251  public:
255  DocumentNotFoundException (const std::string& iWhat)
256  : XapianException (iWhat) {}
257  };
258 
263  public:
267  XapianDatabaseFailureException (const std::string& iWhat)
268  : XapianException (iWhat) {}
269  };
270 
275  public:
279  XapianTravelDatabaseEmptyException (const std::string& iWhat)
280  : XapianException (iWhat) {}
281  };
282 
287  public:
292  : XapianException (iWhat) {}
293  };
294 
299  public:
303  NoBestMatchingResultHolderException (const std::string& iWhat)
304  : RootException (iWhat) {}
305  };
306 
311  public:
315  SQLDatabaseException (const std::string& iWhat) : RootException (iWhat) {}
316  };
317 
322  : public SQLDatabaseException {
323  public:
328  : SQLDatabaseException (iWhat) {}
329  };
330 
335  public:
339  SQLDatabaseImpossibleConnectionException (const std::string& iWhat)
340  : SQLDatabaseException (iWhat) {}
341  };
342 
347  public:
351  SQLDatabaseConnectionReleaseException (const std::string& iWhat)
352  : SQLDatabaseException (iWhat) {}
353  };
354 
359  public:
363  SQLDatabaseFileCannotBeCreatedException (const std::string& iWhat)
364  : SQLDatabaseException (iWhat) {}
365  };
366 
371  public:
375  SQLDatabaseElementNotFoundException (const std::string& iWhat)
376  : SQLDatabaseException (iWhat) {}
377  };
378 
383  public:
387  SQLDatabaseUserCreationException (const std::string& iWhat)
388  : SQLDatabaseException (iWhat) {}
389  };
390 
395  public:
399  SQLDatabaseTableCreationException (const std::string& iWhat)
400  : SQLDatabaseException (iWhat) {}
401  };
402 
407  public:
411  SQLDatabaseIndexCreationException (const std::string& iWhat)
412  : SQLDatabaseException (iWhat) {}
413  };
414 
419  public:
423  BuildIndexException (const std::string& iWhat) : RootException (iWhat) {}
424  };
425 
430  public:
434  InterpreterUseCaseException (const std::string& iWhat)
435  : RootException (iWhat) {}
436  };
437 
442  public:
446  InterpreteTravelRequestException (const std::string& iWhat)
447  : InterpreterUseCaseException (iWhat) {}
448  };
449 
454  public:
458  TravelRequestEmptyException (const std::string& iWhat)
459  : InterpreterUseCaseException (iWhat) {}
460  };
461 
462 }
463 #endif // __OPENTREP_OPENTREP_EXCEPTIONS_HPP
XapianException(const std::string &iWhat)
NonInitialisedServiceException(const std::string &iWhat)
FileExtensionUnknownException(const std::string &iWhat)
FileNotFoundException(const std::string &iWhat)
UnicodeTransliteratorCreationException(const std::string &iWhat)
SQLDatabaseUserCreationException(const std::string &iWhat)
InterpreteTravelRequestException(const std::string &iWhat)
FileUncompressingErrorException(const std::string &iWhat)
NoBestMatchingResultHolderException(const std::string &iWhat)
SQLDatabaseException(const std::string &iWhat)
RootException(const std::string &iWhat)
ParserException(const std::string &iWhat)
InterpreterUseCaseException(const std::string &iWhat)
Root of the OpenTREP exceptions.
CodeDuplicationException(const std::string &iWhat)
FileException(const std::string &iWhat)
MemoryAllocationException(const std::string &iWhat)
SQLDatabaseTableCreationException(const std::string &iWhat)
PorFileParsingException(const std::string &iWhat)
UnicodeException(const std::string &iWhat)
CodeConversionException(const std::string &iWhat)
DocumentNotFoundException(const std::string &iWhat)
SQLDatabaseIndexCreationException(const std::string &iWhat)
ObjectNotFoundException(const std::string &iWhat)
MultipleRowsForASingleDocIDException(const std::string &iWhat)
BuildIndexException(const std::string &iWhat)
SQLDatabaseElementNotFoundException(const std::string &iWhat)
TravelRequestEmptyException(const std::string &iWhat)
XapianDatabaseFailureException(const std::string &iWhat)
PRFileParsingException(const std::string &iWhat)
XapianTravelDatabaseEmptyException(const std::string &iWhat)
const char * what() const