System.Data.SQLite

Check-in [37dcaf8f5d]
Login

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

Overview
Comment:Override the System.Object members for the SQLiteException class to improve its ToString return value. Pursuant to [53962f9eff].
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 37dcaf8f5dcd73da621735c97b5b51099baab98f
User & Date: mistachkin 2018-02-08 00:50:42.734
References
2018-02-08
17:45
Remove overrides of GetHashCode/Equals from SQLiteException (added by check-in [37dcaf8f5d]) because they are superfluous and cannot readily take into account all base class state. check-in: 242ef0c9a1 user: mistachkin tags: trunk
Context
2018-02-08
01:02
Sync up (fallback) error messages with those in the SQLite core library. Mask off extended error codes prior to using the fallback table. Add tests for preserving extended error codes in the SQLiteException class. check-in: accc5da1ee user: mistachkin tags: trunk
00:50
Override the System.Object members for the SQLiteException class to improve its ToString return value. Pursuant to [53962f9eff]. check-in: 37dcaf8f5d user: mistachkin tags: trunk
00:43
Add 'interopError' function to the SQLite interop assembly. check-in: afeca954f4 user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to System.Data.SQLite/SQLiteException.cs.
209
210
211
212
213
214
215












































216
217
218
219
220
221
222
            GetErrorString(errorCode),
#if !NET_COMPACT_20
            Environment.NewLine, message).Trim();
#else
            "\r\n", message).Trim();
#endif
    }












































  }

  /// <summary>
  /// SQLite error codes.  Actually, this enumeration represents a return code,
  /// which may also indicate success in one of several ways (e.g. SQLITE_OK,
  /// SQLITE_ROW, and SQLITE_DONE).  Therefore, the name of this enumeration is
  /// something of a misnomer.







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
            GetErrorString(errorCode),
#if !NET_COMPACT_20
            Environment.NewLine, message).Trim();
#else
            "\r\n", message).Trim();
#endif
    }

    ///////////////////////////////////////////////////////////////////////////

    #region System.Object Overrides
    public override bool Equals(object obj)
    {
        SQLiteException exception = obj as SQLiteException;

        if (exception == null)
            return false;

        if (_errorCode != exception._errorCode)
            return false;

        if (String.Compare(
                Message, exception.Message,
                StringComparison.Ordinal) != 0)
        {
            return false;
        }

        return true;
    }

    ///////////////////////////////////////////////////////////////////////////

    public override int GetHashCode()
    {
        int result = base.GetHashCode();

        result ^= _errorCode.GetHashCode();

        return result;
    }

    ///////////////////////////////////////////////////////////////////////////

    public override string ToString()
    {
        return HelperMethods.StringFormat(
            CultureInfo.CurrentCulture, "code = {0} ({1}), message = {2}",
            _errorCode, (int)_errorCode, base.ToString());
    }
    #endregion
  }

  /// <summary>
  /// SQLite error codes.  Actually, this enumeration represents a return code,
  /// which may also indicate success in one of several ways (e.g. SQLITE_OK,
  /// SQLITE_ROW, and SQLITE_DONE).  Therefore, the name of this enumeration is
  /// something of a misnomer.