是否有文档列出了/什么异常由System.Data.Sqlite对象抛出?出了、抛出、异常、对象

2023-09-04 23:45:25 作者:無奈伤痛

我无法找到文档的 Sqlite.Net数据提供者(System.Data.Sqlite.dll)(新发展有分叉这里),该目录有什么异常的各种类和它们的方法抛出。我知道有一些可以扔掉SqliteExceptions,但是当?

I'm having trouble finding documentation for the Sqlite.Net data provider (System.Data.Sqlite.dll) (new development has forked here) that lists what exceptions are thrown by the various classes and their methods. I know there are SqliteExceptions that can be thrown, but when?

我已确保我有附带System.Data.Sqlite.xml文档文件,但它似乎并没有列出什么异常是由每个方法抛出。

I have ensured I have the accompanying System.Data.Sqlite.xml documentation file, but it doesn't appear to list what exceptions are thrown by each method.

我不想换不必要的code到try / catch块(或盲目地捕捉通用的异常无处不在)。

I don't want to wrap unnecessary code into try/catch blocks (or blindly catch a generic Exception everywhere).

有谁知道我在哪里可以找到这样的文件?我知道,SqliteConnection从DbConnection,和SqliteCommand从DbCommand,因此,如果有必要我想我可以看看文件那里。然而,没有基类将列出SqliteException,所以,当将这些类型的例外被抛出?

Does anyone know where I may find such documentation? I know that SqliteConnection is derived from DbConnection, and SqliteCommand is derived from DbCommand, so if necessary I guess I can look at the documentation there. However, none of the base classes will list SqliteException, so when will those type of exceptions be thrown?

PS - 我使用1.0.64版本(从2009年......不能在这个时候升级)

PS - I'm using version 1.0.64 (from 2009... can't upgrade at this time).

更新:

由于缺乏反应,有没有使用System.Data.Sqlite.dll人在那里?如果是这样,你采取什么样的方式来处理可能从库中可用的对象抛出的异常?有一些标准的方法来处理这​​些异常,因为它似乎没有对所抛出的异常没有文件和哪些类?

Due to the lack of responses, is there anyone out there that uses System.Data.Sqlite.dll? If so, what approach do you take to handle exceptions that may be thrown from the objects available in the library? Is there some standard way to deal with these exceptions since it seems there is no documentation on the exceptions that are thrown and by which classes?

更新2:

我还是设法找到在c发现SQLite.NET文档:\ Program Files文件\ SQLite.NET \文档\(似乎是一种明显)。大文件,到目前为止,但它不会告诉你什么异常抛出。我到目前为止做的最好的是看那些实现了继承基类或接口,看看有什么异常抛出。这仍然没有在明知当SqliteException对象,虽然抛出帮助。

I did manage to find the SQLite.NET documentation found under c:\program files\SQLite.NET\Doc\ (seems kind of obvious). Great documentation so far, however it doesn't tell you what exceptions are thrown. The best I can do so far is to look at the base classes that are inherited or interfaces that are implemented and see what exceptions are thrown. This still doesn't help in knowing when an SqliteException object is thrown though.

更新3:

让一抱之源$ C ​​$ C后,似乎没有任何的类本身包含任何 ///<异常CREF =ExceptionType>出了错&LT!; /异常> XML注释。这就解释了为什么既没有SQLite.NET帮助文件或Visual Studio智能感知列出了可能会引发任何异常。我创建了一个ticket请求XML注释,包括例外,提供了将它们加入到自己,如果它太低的优先级列表。我会继续这个问题,更新任何人任何新的进展谁可能会感兴趣。

After getting a hold of the source code, it appears that none of the classes themselves contain any /// <exception cref="ExceptionType">Something went wrong!</exception> xml comments. This explains why neither the SQLite.NET help file or Visual Studio Intellisense is listing any exceptions that may be thrown. I've created a ticket requesting the xml comments to include the exceptions, offering to add them myself if it is too low on their priority list. I'll keep this question updated with any new developments for anyone who might be interested.

推荐答案

您可以使用蛮力的方式寻找到code或反射的异常。

you could use the "brute" way searching into code or by reflector for Exception.

居: 反射器 - >分析System.Data.SQLite.SQLiteException - >实例化后

Es: reflector --> analyze "System.Data.SQLite.SQLiteException" --> Instantiated By

    System.Data.SQLite.SQLite3.Bind_Blob(SQLiteStatement, Int32, Byte[]) : Void
    System.Data.SQLite.SQLite3.Bind_DateTime(SQLiteStatement, Int32, DateTime) : Void
    System.Data.SQLite.SQLite3.Bind_Double(SQLiteStatement, Int32, Double) : Void
    System.Data.SQLite.SQLite3.Bind_Int32(SQLiteStatement, Int32, Int32) : Void
    System.Data.SQLite.SQLite3.Bind_Int64(SQLiteStatement, Int32, Int64) : Void
    System.Data.SQLite.SQLite3.Bind_Null(SQLiteStatement, Int32) : Void
    System.Data.SQLite.SQLite3.Bind_Text(SQLiteStatement, Int32, String) : Void
    System.Data.SQLite.SQLite3.ChangePassword(Byte[]) : Void
    System.Data.SQLite.SQLite3.ColumnMetaData(String, String, String, String&, String&, Boolean&, Boolean&, Boolean&) : Void
    System.Data.SQLite.SQLite3.CreateCollation(String, SQLiteCollation, SQLiteCollation) : Void
    System.Data.SQLite.SQLite3.CreateFunction(String, Int32, Boolean, SQLiteCallback, SQLiteCallback, SQLiteFinalCallback) : Void
    System.Data.SQLite.SQLite3.GetIndexColumnExtendedInfo(String, String, String, Int32&, Int32&, String&) : Void
    System.Data.SQLite.SQLite3.Open(String, SQLiteOpenFlagsEnum, Int32, Boolean) : Void
    System.Data.SQLite.SQLite3.Prepare(SQLiteConnection, String, SQLiteStatement, UInt32, String&) : SQLiteStatement
    System.Data.SQLite.SQLite3.Reset(SQLiteStatement) : Int32
    System.Data.SQLite.SQLite3.SetPassword(Byte[]) : Void
    System.Data.SQLite.SQLite3.SetTimeout(Int32) : Void
    System.Data.SQLite.SQLite3.Step(SQLiteStatement) : Boolean
    System.Data.SQLite.SQLite3_UTF16.Bind_Text(SQLiteStatement, Int32, String) : Void
    System.Data.SQLite.SQLite3_UTF16.Open(String, SQLiteOpenFlagsEnum, Int32, Boolean) : Void
    System.Data.SQLite.SQLiteBase.CloseConnection(SQLiteConnectionHandle) : Void
    System.Data.SQLite.SQLiteBase.FinalizeStatement(SQLiteStatementHandle) : Void
    System.Data.SQLite.SQLiteBase.ResetConnection(SQLiteConnectionHandle) : Void
    System.Data.SQLite.SQLiteDataReader.CheckClosed() : Void
    System.Data.SQLite.SQLiteStatement.BindParameter(Int32, SQLiteParameter) : Void
    System.Data.SQLite.SQLiteTransaction.IsValid(Boolean) : Boolean
 
精彩推荐
图片推荐