SQLiteError
public struct SQLiteError : Error
extension SQLiteError: CustomStringConvertible
extension SQLiteError: LocalizedError
An error supplying a message, SQLite error code, and description.
-
A brief message describing the error
Declaration
Swift
public let message: String
-
A result code specifying the error
Seealso
Result and Error CodesDeclaration
Swift
public let code: SQLiteResult
-
A more detailed description of the error’s cause
Declaration
Swift
public let details: String?
-
Creates an error with the given message and code.
The description is obtained using
sqlite3_errstr(code)
.Declaration
Swift
public init(_ message: String, code: Int32)
Parameters
message
A brief message describing the error
code
An SQLite error code
-
Creates an error with the given message, with result code and description obtained from
db
.The error code is obtained using
sqlite3_extended_errcode(db)
. The description is obtained usingsqlite3_errmsg(db)
.Declaration
Swift
public init(_ message: String, takingDescriptionFromDatabase db: SQLiteDatabaseConnection)
Parameters
message
A brief message describing the error
db
An
sqlite3 *
database connection handle -
Creates an error with the given message, with result code and description obtained from
stmt
.The error code is obtained using
sqlite3_extended_errcode(sqlite3_db_handle(stmt))
. The description is obtained usingsqlite3_errmsg(sqlite3_db_handle(stmt))
.Declaration
Swift
public init(_ message: String, takingDescriptionFromStatement stmt: SQLitePreparedStatement)
Parameters
message
A brief message describing the error
stmt
An
sqlite3_stmt *
object -
Declaration
Swift
public var description: String { get }
-
Declaration
Swift
public var errorDescription: String? { get }
-
Declaration
Swift
public var failureReason: String? { get }