annotate OrthancFramework/Sources/SQLite/OrthancSQLiteException.h @ 4044:d25f4c0fa160 framework

splitting code into OrthancFramework and OrthancServer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 10 Jun 2020 20:30:34 +0200
parents Core/SQLite/OrthancSQLiteException.h@fa5ad4368fe3
children c847b0dfd255
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1220
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 *
3063
fa5ad4368fe3 new mail address
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2380
diff changeset
4 * Copyright (C) 2012-2016 Sebastien Jodogne <s.jodogne@orthanc-labs.com>,
1220
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 * Medical Physics Department, CHU of Liege, Belgium
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * Copyright (c) 2012 The Chromium Authors. All rights reserved.
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 *
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * Redistribution and use in source and binary forms, with or without
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * modification, are permitted provided that the following conditions are
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * met:
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * * Redistributions of source code must retain the above copyright
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * notice, this list of conditions and the following disclaimer.
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * * Redistributions in binary form must reproduce the above
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * copyright notice, this list of conditions and the following disclaimer
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * in the documentation and/or other materials provided with the
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * distribution.
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * * Neither the name of Google Inc., the name of the CHU of Liege,
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * nor the names of its contributors may be used to endorse or promote
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * products derived from this software without specific prior written
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 * permission.
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 *
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 **/
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 #pragma once
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
2380
96b3ec054b69 reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1900
diff changeset
41 #if ORTHANC_ENABLE_SQLITE != 1
96b3ec054b69 reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1900
diff changeset
42 # error Macro ORTHANC_ENABLE_SQLITE must be set to 1 to use SQLite
96b3ec054b69 reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1900
diff changeset
43 #endif
96b3ec054b69 reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1900
diff changeset
44
96b3ec054b69 reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1900
diff changeset
45
1220
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 #if ORTHANC_SQLITE_STANDALONE == 1
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 #include <stdexcept>
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 namespace Orthanc
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 {
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 namespace SQLite
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 {
1585
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
53 // Auto-generated by "Resources/GenerateErrorCodes.py"
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
54 enum ErrorCode
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
55 {
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
56 ErrorCode_ParameterOutOfRange,
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
57 ErrorCode_BadParameterType,
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
58 ErrorCode_SQLiteNotOpened,
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
59 ErrorCode_SQLiteAlreadyOpened,
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
60 ErrorCode_SQLiteCannotOpen,
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
61 ErrorCode_SQLiteStatementAlreadyUsed,
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
62 ErrorCode_SQLiteExecute,
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
63 ErrorCode_SQLiteRollbackWithoutTransaction,
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
64 ErrorCode_SQLiteCommitWithoutTransaction,
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
65 ErrorCode_SQLiteRegisterFunction,
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
66 ErrorCode_SQLiteFlush,
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
67 ErrorCode_SQLiteCannotRun,
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
68 ErrorCode_SQLiteCannotStep,
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
69 ErrorCode_SQLiteBindOutOfRange,
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
70 ErrorCode_SQLitePrepareStatement,
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
71 ErrorCode_SQLiteTransactionAlreadyStarted,
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
72 ErrorCode_SQLiteTransactionCommit,
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
73 ErrorCode_SQLiteTransactionBegin
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
74 };
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
75
1220
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 class OrthancSQLiteException : public ::std::runtime_error
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 {
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 public:
1585
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
79 OrthancSQLiteException(ErrorCode error) :
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
80 ::std::runtime_error(EnumerationToString(error))
1220
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 {
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 }
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83
1585
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
84 // Auto-generated by "Resources/GenerateErrorCodes.py"
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
85 static const char* EnumerationToString(ErrorCode code)
1220
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 {
1585
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
87 switch (code)
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
88 {
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
89 case ErrorCode_ParameterOutOfRange:
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
90 return "Parameter out of range";
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
91
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
92 case ErrorCode_BadParameterType:
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
93 return "Bad type for a parameter";
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
94
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
95 case ErrorCode_SQLiteNotOpened:
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
96 return "SQLite: The database is not opened";
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
97
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
98 case ErrorCode_SQLiteAlreadyOpened:
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
99 return "SQLite: Connection is already open";
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
100
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
101 case ErrorCode_SQLiteCannotOpen:
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
102 return "SQLite: Unable to open the database";
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
103
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
104 case ErrorCode_SQLiteStatementAlreadyUsed:
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
105 return "SQLite: This cached statement is already being referred to";
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
106
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
107 case ErrorCode_SQLiteExecute:
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
108 return "SQLite: Cannot execute a command";
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
109
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
110 case ErrorCode_SQLiteRollbackWithoutTransaction:
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
111 return "SQLite: Rolling back a nonexistent transaction (have you called Begin()?)";
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
112
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
113 case ErrorCode_SQLiteCommitWithoutTransaction:
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
114 return "SQLite: Committing a nonexistent transaction";
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
115
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
116 case ErrorCode_SQLiteRegisterFunction:
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
117 return "SQLite: Unable to register a function";
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
118
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
119 case ErrorCode_SQLiteFlush:
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
120 return "SQLite: Unable to flush the database";
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
121
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
122 case ErrorCode_SQLiteCannotRun:
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
123 return "SQLite: Cannot run a cached statement";
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
124
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
125 case ErrorCode_SQLiteCannotStep:
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
126 return "SQLite: Cannot step over a cached statement";
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
127
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
128 case ErrorCode_SQLiteBindOutOfRange:
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
129 return "SQLite: Bing a value while out of range (serious error)";
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
130
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
131 case ErrorCode_SQLitePrepareStatement:
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
132 return "SQLite: Cannot prepare a cached statement";
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
133
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
134 case ErrorCode_SQLiteTransactionAlreadyStarted:
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
135 return "SQLite: Beginning the same transaction twice";
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
136
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
137 case ErrorCode_SQLiteTransactionCommit:
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
138 return "SQLite: Failure when committing the transaction";
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
139
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
140 case ErrorCode_SQLiteTransactionBegin:
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
141 return "SQLite: Cannot start a transaction";
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
142
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
143 default:
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
144 return "Unknown error code";
9a3e03d6a4d5 fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1291
diff changeset
145 }
1220
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 }
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 };
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 }
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 }
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 #else
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 # include "../OrthancException.h"
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 # define OrthancSQLiteException ::Orthanc::OrthancException
9b9026560a5f SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 #endif