xapian-core  2.0.0
error.h
Go to the documentation of this file.
1 
4 /* Warning: This file is generated by ./generate-exceptions - do not modify directly! */
5 /* Copyright (C) 2003,2004,2006,2007,2008,2009,2011,2015,2019,2020 Olly Betts
6  * Copyright (C) 2007 Richard Boulton
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of the
11  * License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, see
20  * <https://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef XAPIAN_INCLUDED_ERROR_H
24 #define XAPIAN_INCLUDED_ERROR_H
25 
26 #if !defined XAPIAN_IN_XAPIAN_H && !defined XAPIAN_LIB_BUILD
27 # error Never use <xapian/error.h> directly; include <xapian.h> instead.
28 #endif
29 
30 #include <string>
31 #include <xapian/attributes.h>
32 #include <xapian/visibility.h>
33 
34 namespace Xapian {
35 
43  std::string msg;
44 
51  std::string context;
52 
57  mutable std::string error_string;
58 
60  const char * type;
61 
77  int my_errno;
78 
80  void operator=(const Error &o);
81 
82  protected:
86  Error(std::string_view msg_, std::string_view context_,
87  const char* type_, const char* error_string_);
88 
92  Error(std::string_view msg_, std::string_view context_,
93  const char* type_, int errno_)
94  : msg(msg_), context(context_), error_string(), type(type_),
95  my_errno(errno_) { }
96 
97  public:
103  Error(const Error&) = default;
104 
106  const char* get_type() const noexcept {
107  return type + 1;
108  }
109 
111  const std::string& get_msg() const noexcept {
112  return msg;
113  }
114 
121  const std::string& get_context() const noexcept {
122  return context;
123  }
124 
131  const char * get_error_string() const;
132 
134  std::string get_description() const;
135 };
136 
143  protected:
147  LogicError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
148  : Error(msg_, context_, type_, error_string_) {}
149 
153  LogicError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
154  : Error(msg_, context_, type_, errno_) {}
155 };
156 
165  protected:
169  RuntimeError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
170  : Error(msg_, context_, type_, error_string_) {}
171 
175  RuntimeError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
176  : Error(msg_, context_, type_, errno_) {}
177 };
178 
188  public:
194  AssertionError(std::string_view msg_, std::string_view context_, const char* error_string_)
195  : LogicError(msg_, context_, "\000AssertionError", error_string_) {}
203  explicit AssertionError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
204  : LogicError(msg_, context_, "\000AssertionError", errno_) {}
211  AssertionError(std::string_view msg_, int errno_)
212  : LogicError(msg_, std::string(), "\000AssertionError", errno_) {}
213  protected:
217  AssertionError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
218  : LogicError(msg_, context_, type_, error_string_) {}
219 
223  AssertionError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
224  : LogicError(msg_, context_, type_, errno_) {}
225 };
226 
230  public:
236  InvalidArgumentError(std::string_view msg_, std::string_view context_, const char* error_string_)
237  : LogicError(msg_, context_, "\001InvalidArgumentError", error_string_) {}
245  explicit InvalidArgumentError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
246  : LogicError(msg_, context_, "\001InvalidArgumentError", errno_) {}
253  InvalidArgumentError(std::string_view msg_, int errno_)
254  : LogicError(msg_, std::string(), "\001InvalidArgumentError", errno_) {}
255  protected:
259  InvalidArgumentError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
260  : LogicError(msg_, context_, type_, error_string_) {}
261 
265  InvalidArgumentError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
266  : LogicError(msg_, context_, type_, errno_) {}
267 };
268 
272  public:
278  InvalidOperationError(std::string_view msg_, std::string_view context_, const char* error_string_)
279  : LogicError(msg_, context_, "\002InvalidOperationError", error_string_) {}
287  explicit InvalidOperationError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
288  : LogicError(msg_, context_, "\002InvalidOperationError", errno_) {}
295  InvalidOperationError(std::string_view msg_, int errno_)
296  : LogicError(msg_, std::string(), "\002InvalidOperationError", errno_) {}
297  protected:
301  InvalidOperationError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
302  : LogicError(msg_, context_, type_, error_string_) {}
303 
307  InvalidOperationError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
308  : LogicError(msg_, context_, type_, errno_) {}
309 };
310 
314  public:
320  UnimplementedError(std::string_view msg_, std::string_view context_, const char* error_string_)
321  : LogicError(msg_, context_, "\003UnimplementedError", error_string_) {}
329  explicit UnimplementedError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
330  : LogicError(msg_, context_, "\003UnimplementedError", errno_) {}
337  UnimplementedError(std::string_view msg_, int errno_)
338  : LogicError(msg_, std::string(), "\003UnimplementedError", errno_) {}
339  protected:
343  UnimplementedError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
344  : LogicError(msg_, context_, type_, error_string_) {}
345 
349  UnimplementedError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
350  : LogicError(msg_, context_, type_, errno_) {}
351 };
352 
356  public:
362  DatabaseError(std::string_view msg_, std::string_view context_, const char* error_string_)
363  : RuntimeError(msg_, context_, "\004DatabaseError", error_string_) {}
371  explicit DatabaseError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
372  : RuntimeError(msg_, context_, "\004DatabaseError", errno_) {}
379  DatabaseError(std::string_view msg_, int errno_)
380  : RuntimeError(msg_, std::string(), "\004DatabaseError", errno_) {}
381  protected:
385  DatabaseError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
386  : RuntimeError(msg_, context_, type_, error_string_) {}
387 
391  DatabaseError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
392  : RuntimeError(msg_, context_, type_, errno_) {}
393 };
394 
398  public:
404  DatabaseCorruptError(std::string_view msg_, std::string_view context_, const char* error_string_)
405  : DatabaseError(msg_, context_, "\005DatabaseCorruptError", error_string_) {}
413  explicit DatabaseCorruptError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
414  : DatabaseError(msg_, context_, "\005DatabaseCorruptError", errno_) {}
421  DatabaseCorruptError(std::string_view msg_, int errno_)
422  : DatabaseError(msg_, std::string(), "\005DatabaseCorruptError", errno_) {}
423  protected:
427  DatabaseCorruptError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
428  : DatabaseError(msg_, context_, type_, error_string_) {}
429 
433  DatabaseCorruptError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
434  : DatabaseError(msg_, context_, type_, errno_) {}
435 };
436 
440  public:
446  DatabaseCreateError(std::string_view msg_, std::string_view context_, const char* error_string_)
447  : DatabaseError(msg_, context_, "\006DatabaseCreateError", error_string_) {}
455  explicit DatabaseCreateError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
456  : DatabaseError(msg_, context_, "\006DatabaseCreateError", errno_) {}
463  DatabaseCreateError(std::string_view msg_, int errno_)
464  : DatabaseError(msg_, std::string(), "\006DatabaseCreateError", errno_) {}
465  protected:
469  DatabaseCreateError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
470  : DatabaseError(msg_, context_, type_, error_string_) {}
471 
475  DatabaseCreateError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
476  : DatabaseError(msg_, context_, type_, errno_) {}
477 };
478 
482  public:
488  DatabaseLockError(std::string_view msg_, std::string_view context_, const char* error_string_)
489  : DatabaseError(msg_, context_, "\007DatabaseLockError", error_string_) {}
497  explicit DatabaseLockError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
498  : DatabaseError(msg_, context_, "\007DatabaseLockError", errno_) {}
505  DatabaseLockError(std::string_view msg_, int errno_)
506  : DatabaseError(msg_, std::string(), "\007DatabaseLockError", errno_) {}
507  protected:
511  DatabaseLockError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
512  : DatabaseError(msg_, context_, type_, error_string_) {}
513 
517  DatabaseLockError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
518  : DatabaseError(msg_, context_, type_, errno_) {}
519 };
520 
528  public:
534  DatabaseModifiedError(std::string_view msg_, std::string_view context_, const char* error_string_)
535  : DatabaseError(msg_, context_, "\010DatabaseModifiedError", error_string_) {}
543  explicit DatabaseModifiedError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
544  : DatabaseError(msg_, context_, "\010DatabaseModifiedError", errno_) {}
551  DatabaseModifiedError(std::string_view msg_, int errno_)
552  : DatabaseError(msg_, std::string(), "\010DatabaseModifiedError", errno_) {}
553  protected:
557  DatabaseModifiedError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
558  : DatabaseError(msg_, context_, type_, error_string_) {}
559 
563  DatabaseModifiedError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
564  : DatabaseError(msg_, context_, type_, errno_) {}
565 };
566 
570  public:
576  DatabaseOpeningError(std::string_view msg_, std::string_view context_, const char* error_string_)
577  : DatabaseError(msg_, context_, "\011DatabaseOpeningError", error_string_) {}
585  explicit DatabaseOpeningError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
586  : DatabaseError(msg_, context_, "\011DatabaseOpeningError", errno_) {}
593  DatabaseOpeningError(std::string_view msg_, int errno_)
594  : DatabaseError(msg_, std::string(), "\011DatabaseOpeningError", errno_) {}
595  protected:
599  DatabaseOpeningError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
600  : DatabaseError(msg_, context_, type_, error_string_) {}
601 
605  DatabaseOpeningError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
606  : DatabaseError(msg_, context_, type_, errno_) {}
607 };
608 
621  public:
627  DatabaseVersionError(std::string_view msg_, std::string_view context_, const char* error_string_)
628  : DatabaseOpeningError(msg_, context_, "\012DatabaseVersionError", error_string_) {}
636  explicit DatabaseVersionError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
637  : DatabaseOpeningError(msg_, context_, "\012DatabaseVersionError", errno_) {}
644  DatabaseVersionError(std::string_view msg_, int errno_)
645  : DatabaseOpeningError(msg_, std::string(), "\012DatabaseVersionError", errno_) {}
646  protected:
650  DatabaseVersionError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
651  : DatabaseOpeningError(msg_, context_, type_, error_string_) {}
652 
656  DatabaseVersionError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
657  : DatabaseOpeningError(msg_, context_, type_, errno_) {}
658 };
659 
663  public:
669  DocNotFoundError(std::string_view msg_, std::string_view context_, const char* error_string_)
670  : RuntimeError(msg_, context_, "\013DocNotFoundError", error_string_) {}
678  explicit DocNotFoundError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
679  : RuntimeError(msg_, context_, "\013DocNotFoundError", errno_) {}
686  DocNotFoundError(std::string_view msg_, int errno_)
687  : RuntimeError(msg_, std::string(), "\013DocNotFoundError", errno_) {}
688  protected:
692  DocNotFoundError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
693  : RuntimeError(msg_, context_, type_, error_string_) {}
694 
698  DocNotFoundError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
699  : RuntimeError(msg_, context_, type_, errno_) {}
700 };
701 
708  public:
714  FeatureUnavailableError(std::string_view msg_, std::string_view context_, const char* error_string_)
715  : RuntimeError(msg_, context_, "\014FeatureUnavailableError", error_string_) {}
723  explicit FeatureUnavailableError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
724  : RuntimeError(msg_, context_, "\014FeatureUnavailableError", errno_) {}
731  FeatureUnavailableError(std::string_view msg_, int errno_)
732  : RuntimeError(msg_, std::string(), "\014FeatureUnavailableError", errno_) {}
733  protected:
737  FeatureUnavailableError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
738  : RuntimeError(msg_, context_, type_, error_string_) {}
739 
743  FeatureUnavailableError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
744  : RuntimeError(msg_, context_, type_, errno_) {}
745 };
746 
750  public:
756  InternalError(std::string_view msg_, std::string_view context_, const char* error_string_)
757  : RuntimeError(msg_, context_, "\015InternalError", error_string_) {}
765  explicit InternalError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
766  : RuntimeError(msg_, context_, "\015InternalError", errno_) {}
773  InternalError(std::string_view msg_, int errno_)
774  : RuntimeError(msg_, std::string(), "\015InternalError", errno_) {}
775  protected:
779  InternalError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
780  : RuntimeError(msg_, context_, type_, error_string_) {}
781 
785  InternalError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
786  : RuntimeError(msg_, context_, type_, errno_) {}
787 };
788 
792  public:
798  NetworkError(std::string_view msg_, std::string_view context_, const char* error_string_)
799  : RuntimeError(msg_, context_, "\016NetworkError", error_string_) {}
807  explicit NetworkError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
808  : RuntimeError(msg_, context_, "\016NetworkError", errno_) {}
815  NetworkError(std::string_view msg_, int errno_)
816  : RuntimeError(msg_, std::string(), "\016NetworkError", errno_) {}
817  protected:
821  NetworkError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
822  : RuntimeError(msg_, context_, type_, error_string_) {}
823 
827  NetworkError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
828  : RuntimeError(msg_, context_, type_, errno_) {}
829 };
830 
834  public:
840  NetworkTimeoutError(std::string_view msg_, std::string_view context_, const char* error_string_)
841  : NetworkError(msg_, context_, "\017NetworkTimeoutError", error_string_) {}
849  explicit NetworkTimeoutError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
850  : NetworkError(msg_, context_, "\017NetworkTimeoutError", errno_) {}
857  NetworkTimeoutError(std::string_view msg_, int errno_)
858  : NetworkError(msg_, std::string(), "\017NetworkTimeoutError", errno_) {}
859  protected:
863  NetworkTimeoutError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
864  : NetworkError(msg_, context_, type_, error_string_) {}
865 
869  NetworkTimeoutError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
870  : NetworkError(msg_, context_, type_, errno_) {}
871 };
872 
876  public:
882  QueryParserError(std::string_view msg_, std::string_view context_, const char* error_string_)
883  : RuntimeError(msg_, context_, "\020QueryParserError", error_string_) {}
891  explicit QueryParserError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
892  : RuntimeError(msg_, context_, "\020QueryParserError", errno_) {}
899  QueryParserError(std::string_view msg_, int errno_)
900  : RuntimeError(msg_, std::string(), "\020QueryParserError", errno_) {}
901  protected:
905  QueryParserError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
906  : RuntimeError(msg_, context_, type_, error_string_) {}
907 
911  QueryParserError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
912  : RuntimeError(msg_, context_, type_, errno_) {}
913 };
914 
918  public:
924  SerialisationError(std::string_view msg_, std::string_view context_, const char* error_string_)
925  : RuntimeError(msg_, context_, "\021SerialisationError", error_string_) {}
933  explicit SerialisationError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
934  : RuntimeError(msg_, context_, "\021SerialisationError", errno_) {}
941  SerialisationError(std::string_view msg_, int errno_)
942  : RuntimeError(msg_, std::string(), "\021SerialisationError", errno_) {}
943  protected:
947  SerialisationError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
948  : RuntimeError(msg_, context_, type_, error_string_) {}
949 
953  SerialisationError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
954  : RuntimeError(msg_, context_, type_, errno_) {}
955 };
956 
960  public:
966  RangeError(std::string_view msg_, std::string_view context_, const char* error_string_)
967  : RuntimeError(msg_, context_, "\022RangeError", error_string_) {}
975  explicit RangeError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
976  : RuntimeError(msg_, context_, "\022RangeError", errno_) {}
983  RangeError(std::string_view msg_, int errno_)
984  : RuntimeError(msg_, std::string(), "\022RangeError", errno_) {}
985  protected:
989  RangeError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
990  : RuntimeError(msg_, context_, type_, error_string_) {}
991 
995  RangeError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
996  : RuntimeError(msg_, context_, type_, errno_) {}
997 };
998 
1002  public:
1008  WildcardError(std::string_view msg_, std::string_view context_, const char* error_string_)
1009  : RuntimeError(msg_, context_, "\023WildcardError", error_string_) {}
1017  explicit WildcardError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
1018  : RuntimeError(msg_, context_, "\023WildcardError", errno_) {}
1025  WildcardError(std::string_view msg_, int errno_)
1026  : RuntimeError(msg_, std::string(), "\023WildcardError", errno_) {}
1027  protected:
1031  WildcardError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
1032  : RuntimeError(msg_, context_, type_, error_string_) {}
1033 
1037  WildcardError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
1038  : RuntimeError(msg_, context_, type_, errno_) {}
1039 };
1040 
1044  public:
1050  DatabaseNotFoundError(std::string_view msg_, std::string_view context_, const char* error_string_)
1051  : DatabaseOpeningError(msg_, context_, "\024DatabaseNotFoundError", error_string_) {}
1059  explicit DatabaseNotFoundError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
1060  : DatabaseOpeningError(msg_, context_, "\024DatabaseNotFoundError", errno_) {}
1067  DatabaseNotFoundError(std::string_view msg_, int errno_)
1068  : DatabaseOpeningError(msg_, std::string(), "\024DatabaseNotFoundError", errno_) {}
1069  protected:
1073  DatabaseNotFoundError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
1074  : DatabaseOpeningError(msg_, context_, type_, error_string_) {}
1075 
1079  DatabaseNotFoundError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
1080  : DatabaseOpeningError(msg_, context_, type_, errno_) {}
1081 };
1082 
1086  public:
1092  DatabaseClosedError(std::string_view msg_, std::string_view context_, const char* error_string_)
1093  : DatabaseError(msg_, context_, "\025DatabaseClosedError", error_string_) {}
1101  explicit DatabaseClosedError(std::string_view msg_, std::string_view context_ = {}, int errno_ = 0)
1102  : DatabaseError(msg_, context_, "\025DatabaseClosedError", errno_) {}
1109  DatabaseClosedError(std::string_view msg_, int errno_)
1110  : DatabaseError(msg_, std::string(), "\025DatabaseClosedError", errno_) {}
1111  protected:
1115  DatabaseClosedError(std::string_view msg_, std::string_view context_, const char* type_, const char* error_string_)
1116  : DatabaseError(msg_, context_, type_, error_string_) {}
1117 
1121  DatabaseClosedError(std::string_view msg_, std::string_view context_, const char* type_, int errno_)
1122  : DatabaseError(msg_, context_, type_, errno_) {}
1123 };
1124 
1125 }
1126 
1127 #endif /* XAPIAN_INCLUDED_ERROR_H */
Compiler attribute macros.
AssertionError is thrown if a logical assertion inside Xapian fails.
Definition: error.h:187
AssertionError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:194
AssertionError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:211
AssertionError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:223
AssertionError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:217
AssertionError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:203
Indicates an attempt to access a closed database.
Definition: error.h:1085
DatabaseClosedError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:1092
DatabaseClosedError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:1115
DatabaseClosedError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:1121
DatabaseClosedError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:1101
DatabaseClosedError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:1109
DatabaseCorruptError indicates database corruption was detected.
Definition: error.h:397
DatabaseCorruptError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:413
DatabaseCorruptError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:427
DatabaseCorruptError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:404
DatabaseCorruptError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:433
DatabaseCorruptError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:421
DatabaseCreateError indicates a failure to create a database.
Definition: error.h:439
DatabaseCreateError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:463
DatabaseCreateError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:475
DatabaseCreateError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:446
DatabaseCreateError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:469
DatabaseCreateError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:455
DatabaseError indicates some sort of database related error.
Definition: error.h:355
DatabaseError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:362
DatabaseError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:385
DatabaseError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:379
DatabaseError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:391
DatabaseError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:371
DatabaseLockError indicates failure to lock a database.
Definition: error.h:481
DatabaseLockError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:488
DatabaseLockError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:511
DatabaseLockError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:505
DatabaseLockError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:497
DatabaseLockError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:517
DatabaseModifiedError indicates a database was modified.
Definition: error.h:527
DatabaseModifiedError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:534
DatabaseModifiedError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:543
DatabaseModifiedError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:551
DatabaseModifiedError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:557
DatabaseModifiedError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:563
Indicates an attempt to access a database not present.
Definition: error.h:1043
DatabaseNotFoundError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:1050
DatabaseNotFoundError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:1059
DatabaseNotFoundError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:1079
DatabaseNotFoundError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:1073
DatabaseNotFoundError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:1067
DatabaseOpeningError indicates failure to open a database.
Definition: error.h:569
DatabaseOpeningError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:593
DatabaseOpeningError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:605
DatabaseOpeningError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:585
DatabaseOpeningError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:599
DatabaseOpeningError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:576
DatabaseVersionError indicates that a database is in an unsupported format.
Definition: error.h:620
DatabaseVersionError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:627
DatabaseVersionError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:650
DatabaseVersionError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:644
DatabaseVersionError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:636
DatabaseVersionError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:656
Indicates an attempt to access a document not present in the database.
Definition: error.h:662
DocNotFoundError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:669
DocNotFoundError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:698
DocNotFoundError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:692
DocNotFoundError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:678
DocNotFoundError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:686
All exceptions thrown by Xapian are subclasses of Xapian::Error.
Definition: error.h:41
std::string context
Optional context information.
Definition: error.h:51
int my_errno
Optional value of 'errno' associated with this error.
Definition: error.h:77
std::string error_string
The error string derived from my_errno.
Definition: error.h:57
std::string msg
Message giving details of the error, intended for human consumption.
Definition: error.h:43
const char * type
The type of this error (e.g. DocNotFoundError.)
Definition: error.h:60
void operator=(const Error &o)
Don't allow assignment of the base class.
const std::string & get_msg() const noexcept
Message giving details of the error, intended for human consumption.
Definition: error.h:111
const char * get_type() const noexcept
The type of this error (e.g. "DocNotFoundError".)
Definition: error.h:106
Error(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:92
const std::string & get_context() const noexcept
Optional context information.
Definition: error.h:121
Error(const Error &)=default
Default copy constructor.
Indicates an attempt to use a feature which is unavailable.
Definition: error.h:707
FeatureUnavailableError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:714
FeatureUnavailableError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:743
FeatureUnavailableError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:723
FeatureUnavailableError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:737
FeatureUnavailableError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:731
InternalError indicates a runtime problem of some sort.
Definition: error.h:749
InternalError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:785
InternalError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:756
InternalError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:773
InternalError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:779
InternalError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:765
InvalidArgumentError indicates an invalid parameter value was passed to the API.
Definition: error.h:229
InvalidArgumentError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:259
InvalidArgumentError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:253
InvalidArgumentError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:245
InvalidArgumentError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:265
InvalidArgumentError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:236
InvalidOperationError indicates the API was used in an invalid way.
Definition: error.h:271
InvalidOperationError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:278
InvalidOperationError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:307
InvalidOperationError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:287
InvalidOperationError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:295
InvalidOperationError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:301
The base class for exceptions indicating errors in the program logic.
Definition: error.h:142
LogicError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:153
LogicError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:147
Indicates a problem communicating with a remote database.
Definition: error.h:791
NetworkError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:821
NetworkError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:827
NetworkError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:807
NetworkError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:815
NetworkError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:798
Indicates a timeout expired while communicating with a remote database.
Definition: error.h:833
NetworkTimeoutError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:840
NetworkTimeoutError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:849
NetworkTimeoutError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:863
NetworkTimeoutError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:857
NetworkTimeoutError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:869
Indicates a query string can't be parsed.
Definition: error.h:875
QueryParserError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:905
QueryParserError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:899
QueryParserError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:891
QueryParserError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:911
QueryParserError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:882
RangeError indicates an attempt to access outside the bounds of a container.
Definition: error.h:959
RangeError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:975
RangeError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:989
RangeError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:983
RangeError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:966
RangeError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:995
The base class for exceptions indicating errors only detectable at runtime.
Definition: error.h:164
RuntimeError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:175
RuntimeError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:169
Indicates an error in the std::string serialisation of an object.
Definition: error.h:917
SerialisationError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:924
SerialisationError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:947
SerialisationError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:933
SerialisationError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:941
SerialisationError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:953
UnimplementedError indicates an attempt to use an unimplemented feature.
Definition: error.h:313
UnimplementedError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:329
UnimplementedError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:320
UnimplementedError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:343
UnimplementedError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:349
UnimplementedError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:337
WildcardError indicates an error expanding a wildcarded query.
Definition: error.h:1001
WildcardError(std::string_view msg_, std::string_view context_, const char *type_, int errno_)
Constructor for use by constructors of derived classes.
Definition: error.h:1037
WildcardError(std::string_view msg_, int errno_)
Construct from message and errno value.
Definition: error.h:1025
WildcardError(std::string_view msg_, std::string_view context_, const char *type_, const char *error_string_)
Constructor for use by constructors of derived classes.
Definition: error.h:1031
WildcardError(std::string_view msg_, std::string_view context_, const char *error_string_)
Private constructor for use by remote backend.
Definition: error.h:1008
WildcardError(std::string_view msg_, std::string_view context_={}, int errno_=0)
General purpose constructor.
Definition: error.h:1017
The Xapian namespace contains public interfaces for the Xapian library.
Definition: compactor.cc:82
Define XAPIAN_VISIBILITY_* macros.
#define XAPIAN_VISIBILITY_DEFAULT
Definition: visibility.h:28