Fix DatabaseError documentation

This commit is contained in:
Gwendal Roué committed 2023-03-02 06:58:33 +01:00
1 parent cc567f2555
commit e936d6b42d
1 file changed
+5 -3
+5 -3
View File
@@ -216,10 +216,12 @@ extension ResultCode: Sendable { }
/// do {
/// try player.insert(db)
/// } catch let error as DatabaseError {
/// switch error.resultCode {
/// case ResultCode.SQLITE_CONSTRAINT_FOREIGNKEY:
/// print(error) // prints debugging information
///
/// switch error {
/// case DatabaseError.SQLITE_CONSTRAINT_FOREIGNKEY:
/// // foreign key constraint error
/// case ResultCode.SQLITE_CONSTRAINT:
/// case DatabaseError.SQLITE_CONSTRAINT:
/// // any other constraint error
/// default:
/// // any other database error