SQLite.swift icon indicating copy to clipboard operation
SQLite.swift copied to clipboard

Why is there a try! in the codebase?

Open DanielEdrisian opened this issue 1 year ago • 4 comments

Build Information

  • Include the SQLite.swift version, commit or branch experiencing the issue. 0.15.3

  • Mention Xcode and OS X versions affected. All

  • How do do you integrate SQLite.swift in your project?

    • Swift Package manager

General guidelines

In Core/Statement.swift, this try! causes a crash on some of my users: Screenshot 2024-12-16 at 6 22 00 PM

It happens when trying db.prepare. When the function is already throwable, it should be expected that it never fatally crashes the app, but rather throw an error which I could either catch or ignore. Screenshot 2024-12-16 at 6 28 32 PM

That way I could act on the error. Otherwise this is not good for the UX. Would really appreciate any help!

DanielEdrisian avatar Dec 17 '24 02:12 DanielEdrisian

Second this, I'm getting a crash right now due to this on a user's device, I assume it's a corrupt DB but the app still shouldn't crash.

StuartCameronCode avatar Dec 29 '24 07:12 StuartCameronCode

any update?

xiushaomin avatar Mar 13 '25 06:03 xiushaomin

Just fork it @xiushaomin

DanielEdrisian avatar Mar 13 '25 06:03 DanielEdrisian

I can confirm: Also the linux version is affected. Catching errors is truly important for a reliable framework!

baltobor avatar May 07 '25 11:05 baltobor