Mercurial > hg > orthanc
annotate OrthancFramework/Sources/SQLite/OrthancSQLiteException.h @ 4932:b7ce2bb6b881 more-tags
refactored the list of MainDicomTags to be able to change it dynamicaly. Unit tests and Integration tests ok
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 09 Mar 2022 11:17:08 +0100 |
parents | 43e613a7756b |
children | 0ea402b4d901 |
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 | 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 |
4870
43e613a7756b
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4831
diff
changeset
|
6 * Copyright (C) 2017-2022 Osimis S.A., Belgium |
43e613a7756b
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4831
diff
changeset
|
7 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
1220
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 * 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
|
10 * |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * 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
|
12 * 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
|
13 * met: |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * * 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
|
16 * 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 * * 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
|
18 * 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
|
19 * 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
|
20 * distribution. |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 * * 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
|
22 * 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
|
23 * 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
|
24 * permission. |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 * |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 * 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
|
27 * "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
|
28 * 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
|
29 * 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
|
30 * 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
|
31 * 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
|
32 * 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
|
33 * 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
|
34 * 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
|
35 * (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
|
36 * 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
|
37 **/ |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 |
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 #pragma once |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 |
2380
96b3ec054b69
reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
43 #if ORTHANC_ENABLE_SQLITE != 1 |
96b3ec054b69
reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
44 # 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
|
45 #endif |
96b3ec054b69
reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
46 |
96b3ec054b69
reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
47 |
1220
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 #if ORTHANC_SQLITE_STANDALONE == 1 |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 #include <stdexcept> |
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 Orthanc |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 { |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 namespace SQLite |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 { |
4932
b7ce2bb6b881
refactored the list of MainDicomTags to be able to change it dynamicaly. Unit tests and Integration tests ok
Alain Mazy <am@osimis.io>
parents:
4870
diff
changeset
|
55 // Auto-generated by "Resources/CodeGeneration/GenerateErrorCodes.py" |
1585
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
56 enum ErrorCode |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
57 { |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
58 ErrorCode_ParameterOutOfRange, |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
59 ErrorCode_BadParameterType, |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
60 ErrorCode_SQLiteNotOpened, |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
61 ErrorCode_SQLiteAlreadyOpened, |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
62 ErrorCode_SQLiteCannotOpen, |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
63 ErrorCode_SQLiteStatementAlreadyUsed, |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
64 ErrorCode_SQLiteExecute, |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
65 ErrorCode_SQLiteRollbackWithoutTransaction, |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
66 ErrorCode_SQLiteCommitWithoutTransaction, |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
67 ErrorCode_SQLiteRegisterFunction, |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
68 ErrorCode_SQLiteFlush, |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
69 ErrorCode_SQLiteCannotRun, |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
70 ErrorCode_SQLiteCannotStep, |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
71 ErrorCode_SQLiteBindOutOfRange, |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
72 ErrorCode_SQLitePrepareStatement, |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
73 ErrorCode_SQLiteTransactionAlreadyStarted, |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
74 ErrorCode_SQLiteTransactionCommit, |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
75 ErrorCode_SQLiteTransactionBegin |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
76 }; |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
77 |
1220
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 class OrthancSQLiteException : public ::std::runtime_error |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 { |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 public: |
1585
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
81 OrthancSQLiteException(ErrorCode error) : |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
82 ::std::runtime_error(EnumerationToString(error)) |
1220
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 { |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 } |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 |
4932
b7ce2bb6b881
refactored the list of MainDicomTags to be able to change it dynamicaly. Unit tests and Integration tests ok
Alain Mazy <am@osimis.io>
parents:
4870
diff
changeset
|
86 // Auto-generated by "Resources/CodeGeneration/GenerateErrorCodes.py" |
1585
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
87 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
|
88 { |
1585
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
89 switch (code) |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
90 { |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
91 case ErrorCode_ParameterOutOfRange: |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
92 return "Parameter out of range"; |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
93 |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
94 case ErrorCode_BadParameterType: |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
95 return "Bad type for a parameter"; |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
96 |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
97 case ErrorCode_SQLiteNotOpened: |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
98 return "SQLite: The database is not opened"; |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
99 |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
100 case ErrorCode_SQLiteAlreadyOpened: |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
101 return "SQLite: Connection is already open"; |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
102 |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
103 case ErrorCode_SQLiteCannotOpen: |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
104 return "SQLite: Unable to open the database"; |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
105 |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
106 case ErrorCode_SQLiteStatementAlreadyUsed: |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
107 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
|
108 |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
109 case ErrorCode_SQLiteExecute: |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
110 return "SQLite: Cannot execute a command"; |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
111 |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
112 case ErrorCode_SQLiteRollbackWithoutTransaction: |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
113 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
|
114 |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
115 case ErrorCode_SQLiteCommitWithoutTransaction: |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
116 return "SQLite: Committing a nonexistent transaction"; |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
117 |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
118 case ErrorCode_SQLiteRegisterFunction: |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
119 return "SQLite: Unable to register a function"; |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
120 |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
121 case ErrorCode_SQLiteFlush: |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
122 return "SQLite: Unable to flush the database"; |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
123 |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
124 case ErrorCode_SQLiteCannotRun: |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
125 return "SQLite: Cannot run a cached statement"; |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
126 |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
127 case ErrorCode_SQLiteCannotStep: |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
128 return "SQLite: Cannot step over a cached statement"; |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
129 |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
130 case ErrorCode_SQLiteBindOutOfRange: |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
131 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
|
132 |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
133 case ErrorCode_SQLitePrepareStatement: |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
134 return "SQLite: Cannot prepare a cached statement"; |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
135 |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
136 case ErrorCode_SQLiteTransactionAlreadyStarted: |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
137 return "SQLite: Beginning the same transaction twice"; |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
138 |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
139 case ErrorCode_SQLiteTransactionCommit: |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
140 return "SQLite: Failure when committing the transaction"; |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
141 |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
142 case ErrorCode_SQLiteTransactionBegin: |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
143 return "SQLite: Cannot start a transaction"; |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
144 |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
145 default: |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
146 return "Unknown error code"; |
9a3e03d6a4d5
fix sqlite standalone build
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1291
diff
changeset
|
147 } |
1220
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 } |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
152 |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
153 #else |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
154 # include "../OrthancException.h" |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
155 # define OrthancSQLiteException ::Orthanc::OrthancException |
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
156 #endif |