Lucene++ - a full-featured, c++ search engine
API Documentation


LuceneException.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3 // Distributable under the terms of either the Apache License (Version 2.0)
4 // or the GNU Lesser General Public License.
6 
7 #ifndef LUCENEEXCEPTION_H
8 #define LUCENEEXCEPTION_H
9 
10 #include "Lucene.h"
11 
12 namespace Lucene {
13 
15 class LPPAPI LuceneException : public std::exception {
16 public:
27  IO,
45  UnsupportedOperation
46  };
47 
48  LuceneException(const String& error = EmptyString, LuceneException::ExceptionType type = Null) throw();
49  ~LuceneException() throw();
50 
51 protected:
53  String error;
54 
55  std::string _what;
56 
57 public:
58  ExceptionType getType() const;
59  String getError() const;
60  bool isNull() const;
61  void throwException();
62 
63  virtual const char* what() const throw();
64 };
65 
66 template <class ParentException, LuceneException::ExceptionType Type>
67 class ExceptionTemplate : public ParentException {
68 public:
69  ExceptionTemplate(const String& error = EmptyString, LuceneException::ExceptionType type = Type) : ParentException(error, type) {
70  }
71 };
72 
100 }
101 
102 #endif
Lucene::LuceneException::Parse
@ Parse
Definition: LuceneException.h:37
Lucene::LuceneException::IllegalArgument
@ IllegalArgument
Definition: LuceneException.h:24
Lucene::LuceneException::OutOfMemory
@ OutOfMemory
Definition: LuceneException.h:36
Lucene::QueryParserError
ExceptionTemplate< LuceneException, LuceneException::QueryParser > QueryParserError
Definition: LuceneException.h:98
Lucene::IllegalArgumentException
ExceptionTemplate< RuntimeException, LuceneException::IllegalArgument > IllegalArgumentException
Definition: LuceneException.h:77
Lucene::NoSuchDirectoryException
ExceptionTemplate< FileNotFoundException, LuceneException::NoSuchDirectory > NoSuchDirectoryException
Definition: LuceneException.h:95
Lucene::CompressionException
ExceptionTemplate< LuceneException, LuceneException::Compression > CompressionException
Definition: LuceneException.h:99
Lucene::AlreadyClosedException
ExceptionTemplate< IllegalStateException, LuceneException::AlreadyClosed > AlreadyClosedException
Definition: LuceneException.h:87
Lucene::LuceneException::LockReleaseFailed
@ LockReleaseFailed
Definition: LuceneException.h:29
Lucene::NullPointerException
ExceptionTemplate< RuntimeException, LuceneException::NullPointer > NullPointerException
Definition: LuceneException.h:79
Lucene::LuceneException::NullPointer
@ NullPointer
Definition: LuceneException.h:34
Lucene::TimeExceededException
ExceptionTemplate< RuntimeException, LuceneException::TimeExceeded > TimeExceededException
Definition: LuceneException.h:83
Lucene::LuceneException::QueryParser
@ QueryParser
Definition: LuceneException.h:38
Lucene::TemporaryException
ExceptionTemplate< LuceneException, LuceneException::Temporary > TemporaryException
Definition: LuceneException.h:75
Lucene::LuceneException::LuceneException
LuceneException(const String &error=EmptyString, LuceneException::ExceptionType type=Null)
Lucene::LuceneException::Lookahead
@ Lookahead
Definition: LuceneException.h:30
Lucene::LuceneException::NumberFormat
@ NumberFormat
Definition: LuceneException.h:35
Lucene::FieldReaderException
ExceptionTemplate< RuntimeException, LuceneException::FieldReader > FieldReaderException
Definition: LuceneException.h:80
Lucene::LuceneException::FileNotFound
@ FileNotFound
Definition: LuceneException.h:23
Lucene::LuceneException::Null
@ Null
Definition: LuceneException.h:18
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::LuceneException::IO
@ IO
Definition: LuceneException.h:27
Lucene::ExceptionTemplate::ExceptionTemplate
ExceptionTemplate(const String &error=EmptyString, LuceneException::ExceptionType type=Type)
Definition: LuceneException.h:69
Lucene::StopFillCacheException
ExceptionTemplate< RuntimeException, LuceneException::StopFillCache > StopFillCacheException
Definition: LuceneException.h:82
Lucene::LuceneException::TooManyClauses
@ TooManyClauses
Definition: LuceneException.h:44
Lucene::ParseException
ExceptionTemplate< LuceneException, LuceneException::Parse > ParseException
Definition: LuceneException.h:97
Lucene::RuntimeException
ExceptionTemplate< LuceneException, LuceneException::Runtime > RuntimeException
Definition: LuceneException.h:73
Lucene::StaleReaderException
ExceptionTemplate< IOException, LuceneException::StaleReader > StaleReaderException
Definition: LuceneException.h:94
Lucene::LuceneException::StopFillCache
@ StopFillCache
Definition: LuceneException.h:41
Lucene::LuceneException::FieldReader
@ FieldReader
Definition: LuceneException.h:22
Lucene::LuceneException::Compression
@ Compression
Definition: LuceneException.h:20
Lucene::LuceneException::Temporary
@ Temporary
Definition: LuceneException.h:42
Lucene::LuceneException::IllegalState
@ IllegalState
Definition: LuceneException.h:25
Lucene::LuceneException::MergeAborted
@ MergeAborted
Definition: LuceneException.h:31
Lucene::TooManyClausesException
ExceptionTemplate< RuntimeException, LuceneException::TooManyClauses > TooManyClausesException
Definition: LuceneException.h:84
Lucene::ExceptionTemplate
Definition: LuceneException.h:67
Lucene::IndexOutOfBoundsException
ExceptionTemplate< RuntimeException, LuceneException::IndexOutOfBounds > IndexOutOfBoundsException
Definition: LuceneException.h:78
Lucene::LockReleaseFailedException
ExceptionTemplate< IOException, LuceneException::LockReleaseFailed > LockReleaseFailedException
Definition: LuceneException.h:92
Lucene::LuceneException::IndexOutOfBounds
@ IndexOutOfBounds
Definition: LuceneException.h:26
Lucene::FileNotFoundException
ExceptionTemplate< IOException, LuceneException::FileNotFound > FileNotFoundException
Definition: LuceneException.h:90
Lucene::LuceneException
Lucene exception container.
Definition: LuceneException.h:15
Lucene::LuceneException::TimeExceeded
@ TimeExceeded
Definition: LuceneException.h:43
Lucene::LuceneException::NoSuchDirectory
@ NoSuchDirectory
Definition: LuceneException.h:33
Lucene::OutOfMemoryError
ExceptionTemplate< LuceneException, LuceneException::OutOfMemory > OutOfMemoryError
Definition: LuceneException.h:74
Lucene::MergeException
ExceptionTemplate< RuntimeException, LuceneException::Merge > MergeException
Definition: LuceneException.h:81
Lucene::LuceneException::CorruptIndex
@ CorruptIndex
Definition: LuceneException.h:21
Lucene::LuceneException::Runtime
@ Runtime
Definition: LuceneException.h:39
Lucene::LuceneException::Merge
@ Merge
Definition: LuceneException.h:32
Lucene::LuceneException::LockObtainFailed
@ LockObtainFailed
Definition: LuceneException.h:28
Lucene::LookaheadSuccess
ExceptionTemplate< LuceneException, LuceneException::Lookahead > LookaheadSuccess
Definition: LuceneException.h:96
Lucene::IllegalStateException
ExceptionTemplate< RuntimeException, LuceneException::IllegalState > IllegalStateException
Definition: LuceneException.h:76
Lucene::NumberFormatException
ExceptionTemplate< IllegalArgumentException, LuceneException::NumberFormat > NumberFormatException
Definition: LuceneException.h:86
Lucene::LuceneException::AlreadyClosed
@ AlreadyClosed
Definition: LuceneException.h:19
Lucene::LockObtainFailedException
ExceptionTemplate< IOException, LuceneException::LockObtainFailed > LockObtainFailedException
Definition: LuceneException.h:91
Lucene::UnsupportedOperationException
ExceptionTemplate< RuntimeException, LuceneException::UnsupportedOperation > UnsupportedOperationException
Definition: LuceneException.h:85
Lucene::MergeAbortedException
ExceptionTemplate< IOException, LuceneException::MergeAborted > MergeAbortedException
Definition: LuceneException.h:93
Lucene::IOException
ExceptionTemplate< LuceneException, LuceneException::IO > IOException
Definition: LuceneException.h:88
Lucene::LuceneException::~LuceneException
~LuceneException()
Lucene::LuceneException::StaleReader
@ StaleReader
Definition: LuceneException.h:40
Lucene::LuceneException::ExceptionType
ExceptionType
Definition: LuceneException.h:17
Lucene::CorruptIndexException
ExceptionTemplate< IOException, LuceneException::CorruptIndex > CorruptIndexException
Definition: LuceneException.h:89

clucene.sourceforge.net