mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-28 04:24:20 +00:00
Update Database.logError documentation, and make it clear that it has to be called very very early.
This commit is contained in:
1 parent
5b7f4a7ff5
commit
f356f8734a
1 file changed
+3
-1
@@ -5466,7 +5466,7 @@ See [prepared statements](#prepared-statements) and [DatabaseValue](#databaseval
|
||||
|
||||
**SQLite can be configured to invoke a callback function containing an error code and a terse error message whenever anomalies occur.**
|
||||
|
||||
It is recommended that you setup, early in the lifetime of your application, the error logging callback:
|
||||
This global error callback must be configured early in the lifetime of your application:
|
||||
|
||||
```swift
|
||||
Database.logError = { (resultCode, message) in
|
||||
@@ -5474,6 +5474,8 @@ Database.logError = { (resultCode, message) in
|
||||
}
|
||||
```
|
||||
|
||||
> :warning: **Warning**: Database.logError must be set before any database connection is opened. This includes the connections that your application opens with GRDB, but also connections opened by other tools, such as third-party libraries. Setting it after a connection has been opened is an SQLite misuse, and has no effect.
|
||||
|
||||
See [The Error And Warning Log](https://sqlite.org/errlog.html) for more information.
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user