OpenTREP Logo  0.07.10
C++ Open Travel Request Parsing Library
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 SerDeException : public RootException {
181  public:
185  SerDeException (const std::string& iWhat) : RootException (iWhat) {}
186  };
187 
191  class ParserException : public RootException {
192  public:
196  ParserException (const std::string& iWhat) : RootException (iWhat) {}
197  };
198 
203  public:
207  PorFileParsingException (const std::string& iWhat)
208  : ParserException (iWhat) {}
209  };
210 
215  public:
219  PRFileParsingException (const std::string& iWhat)
220  : ParserException (iWhat) {}
221  };
222 
227  public:
231  CodeConversionException (const std::string& iWhat)
232  : ParserException (iWhat) {}
233  };
234 
239  public:
243  CodeDuplicationException (const std::string& iWhat)
244  : ParserException (iWhat) {}
245  };
246 
251  public:
255  XapianException (const std::string& iWhat) : RootException (iWhat) {}
256  };
257 
262  public:
266  DocumentNotFoundException (const std::string& iWhat)
267  : XapianException (iWhat) {}
268  };
269 
274  public:
278  XapianDatabaseFailureException (const std::string& iWhat)
279  : XapianException (iWhat) {}
280  };
281 
286  public:
290  XapianTravelDatabaseEmptyException (const std::string& iWhat)
291  : XapianException (iWhat) {}
292  };
293 
298  public:
303  : XapianException (iWhat) {}
304  };
305 
310  public:
314  NoBestMatchingResultHolderException (const std::string& iWhat)
315  : RootException (iWhat) {}
316  };
317 
322  public:
326  SQLDatabaseException (const std::string& iWhat) : RootException (iWhat) {}
327  };
328 
333  : public SQLDatabaseException {
334  public:
339  : SQLDatabaseException (iWhat) {}
340  };
341 
346  public:
350  SQLDatabaseImpossibleConnectionException (const std::string& iWhat)
351  : SQLDatabaseException (iWhat) {}
352  };
353 
358  public:
362  SQLDatabaseConnectionReleaseException (const std::string& iWhat)
363  : SQLDatabaseException (iWhat) {}
364  };
365 
370  public:
374  SQLDatabaseFileCannotBeCreatedException (const std::string& iWhat)
375  : SQLDatabaseException (iWhat) {}
376  };
377 
382  public:
386  SQLDatabaseElementNotFoundException (const std::string& iWhat)
387  : SQLDatabaseException (iWhat) {}
388  };
389 
394  public:
398  SQLDatabaseUserCreationException (const std::string& iWhat)
399  : SQLDatabaseException (iWhat) {}
400  };
401 
406  public:
410  SQLDatabaseTableCreationException (const std::string& iWhat)
411  : SQLDatabaseException (iWhat) {}
412  };
413 
418  public:
422  SQLDatabaseIndexCreationException (const std::string& iWhat)
423  : SQLDatabaseException (iWhat) {}
424  };
425 
430  public:
434  BuildIndexException (const std::string& iWhat) : RootException (iWhat) {}
435  };
436 
441  public:
445  InterpreterUseCaseException (const std::string& iWhat)
446  : RootException (iWhat) {}
447  };
448 
453  public:
457  InterpreteTravelRequestException (const std::string& iWhat)
458  : InterpreterUseCaseException (iWhat) {}
459  };
460 
465  public:
469  TravelRequestEmptyException (const std::string& iWhat)
470  : InterpreterUseCaseException (iWhat) {}
471  };
472 
473 }
474 #endif // __OPENTREP_OPENTREP_EXCEPTIONS_HPP
BuildIndexException(const std::string &iWhat)
CodeConversionException(const std::string &iWhat)
CodeDuplicationException(const std::string &iWhat)
DocumentNotFoundException(const std::string &iWhat)
FileException(const std::string &iWhat)
FileExtensionUnknownException(const std::string &iWhat)
FileNotFoundException(const std::string &iWhat)
FileUncompressingErrorException(const std::string &iWhat)
InterpreteTravelRequestException(const std::string &iWhat)
InterpreterUseCaseException(const std::string &iWhat)
MemoryAllocationException(const std::string &iWhat)
MultipleRowsForASingleDocIDException(const std::string &iWhat)
NoBestMatchingResultHolderException(const std::string &iWhat)
NonInitialisedServiceException(const std::string &iWhat)
ObjectNotFoundException(const std::string &iWhat)
PRFileParsingException(const std::string &iWhat)
ParserException(const std::string &iWhat)
PorFileParsingException(const std::string &iWhat)
Root of the OpenTREP exceptions.
RootException(const std::string &iWhat)
const char * what() const
SQLDatabaseElementNotFoundException(const std::string &iWhat)
SQLDatabaseException(const std::string &iWhat)
SQLDatabaseIndexCreationException(const std::string &iWhat)
SQLDatabaseTableCreationException(const std::string &iWhat)
SQLDatabaseUserCreationException(const std::string &iWhat)
SerDeException(const std::string &iWhat)
TravelRequestEmptyException(const std::string &iWhat)
UnicodeException(const std::string &iWhat)
UnicodeTransliteratorCreationException(const std::string &iWhat)
XapianDatabaseFailureException(const std::string &iWhat)
XapianException(const std::string &iWhat)
XapianTravelDatabaseEmptyException(const std::string &iWhat)