System.Data.SQLite

Check-in [e5d82630c6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:no message
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | sourceforge
Files: files | file ages | folders
SHA1: e5d82630c66654155fef7c09a54eac977e904d88
User & Date: rmsimpson 2005-08-06 00:04:37.000
Context
2005-08-06
01:23
no message check-in: b2133d3bd1 user: rmsimpson tags: sourceforge
00:04
no message check-in: e5d82630c6 user: rmsimpson tags: sourceforge
2005-08-05
06:14
1.0.12 final check-in: 9e5f1b5614 user: rmsimpson tags: sourceforge
Changes
Unified Diff Ignore Whitespace Patch
Changes to System.Data.SQLite/SQLiteException.cs.
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172

    /// <summary>
    /// Public constructor for generating a SQLite error given the base error code
    /// </summary>
    /// <param name="errorCode">The SQLite error code to report</param>
    /// <param name="extendedInformation">Extra text to go along with the error message text</param>
    public SQLiteException(int errorCode, string extendedInformation)
      : base(Initialize(errorCode, extendedInformation))
    {
      _errorCode = (SQLiteErrorCode)errorCode;
    }

    /// <summary>
    /// Various public constructors that just pass along to the base Exception
    /// </summary>







|







158
159
160
161
162
163
164
165
166
167
168
169
170
171
172

    /// <summary>
    /// Public constructor for generating a SQLite error given the base error code
    /// </summary>
    /// <param name="errorCode">The SQLite error code to report</param>
    /// <param name="extendedInformation">Extra text to go along with the error message text</param>
    public SQLiteException(int errorCode, string extendedInformation)
      : base(GetStockErrorMessage(errorCode, extendedInformation))
    {
      _errorCode = (SQLiteErrorCode)errorCode;
    }

    /// <summary>
    /// Various public constructors that just pass along to the base Exception
    /// </summary>
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218



219
220
221
222
223
224
225
226
227
228
229

230
231
232
233
234
235
236

    /// <summary>
    /// Initializes the exception class with the SQLite error code.
    /// </summary>
    /// <param name="errorCode">The SQLite error code</param>
    /// <param name="errorMessage">A detailed error message</param>
    /// <returns>An error message string</returns>
    /// <remarks>
    /// The SQLite error code is OR'd with 0x800F0000 to generate an HResult
    /// </remarks>
    private static string Initialize(int errorCode, string errorMessage)
    {
      if (errorMessage == null) errorMessage = "";

      if (errorMessage.Length > 0)
        errorMessage = "\r\n" + errorMessage;




      return _errorMessages[errorCode] + errorMessage;
    }

    private static string[] _errorMessages = {
      "SQLite OK",
      "SQLite error",
      "An internal logic error in SQLite",
      "Access permission denied",
      "Callback routine requested an abort",
      "The database file is locked",

      "malloc() failed",
      "Atempt to write a read-only database",
      "Operation terminated by sqlite3_interrupt()",
      "Some kind of disk I/O error occurred",
      "The database disk image is malformed",
      "Table or record not found",
      "Insertion failed because the database is full",







<
<
<
|





>
>
>











>







203
204
205
206
207
208
209



210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237

    /// <summary>
    /// Initializes the exception class with the SQLite error code.
    /// </summary>
    /// <param name="errorCode">The SQLite error code</param>
    /// <param name="errorMessage">A detailed error message</param>
    /// <returns>An error message string</returns>



    private static string GetStockErrorMessage(int errorCode, string errorMessage)
    {
      if (errorMessage == null) errorMessage = "";

      if (errorMessage.Length > 0)
        errorMessage = "\r\n" + errorMessage;

      if (errorCode < 0 || errorCode >= _errorMessages.Length)
        errorCode = 1;

      return _errorMessages[errorCode] + errorMessage;
    }

    private static string[] _errorMessages = {
      "SQLite OK",
      "SQLite error",
      "An internal logic error in SQLite",
      "Access permission denied",
      "Callback routine requested an abort",
      "The database file is locked",
      "A table in the database is locked",
      "malloc() failed",
      "Atempt to write a read-only database",
      "Operation terminated by sqlite3_interrupt()",
      "Some kind of disk I/O error occurred",
      "The database disk image is malformed",
      "Table or record not found",
      "Insertion failed because the database is full",