How to throw an error from inTransaction block in FMDB framework

35 views
Skip to first unread message

Orkhan Alizada

unread,
Feb 23, 2023, 4:49:38 PM2/23/23
to FMDB

Is it possible to throw an error inside of the inTransaction block? Like:

self.queue!.inTransaction { db, rollback in 
 do { 
 let rs = try db.executeQuery(some_query_here, values: nil) 

 while rs.next() { // do smth here } 
 rs.close() 
 }  catch { 
 rollback.pointee = true 
 // THROW ERROR HERE
 }
 }

So basically I want to throw an error in catch block. But unfortunately inTransaction method is not throwable. Can I do something here?


Karl-Liebknecht-Str.32, 10178 Berlin, Germany
Verve Group Europe GmbH (previously PubNative GmbH) | Amtsgericht Charlottenburg (Berlin): HRB 160880 B | Managing Directors: Ionut Ciobotaru, Sameer Sondhi | VAT ID: DE296557765
Reply all
Reply to author
Forward
0 new messages