stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.57k stars 1.54k forks source link

Crash - Statement.swift line 211 #1118

Open amandalragone opened 2 years ago

amandalragone commented 2 years ago

After including SQLite in my project, I saw this crash:

SQLite/Statement.swift:211: Fatal error: 'try!' expression unexpectedly raised an error: disk I/O error (code: 10)

It looks like it's coming from here:

extension FailableIterator {
    public func next() -> Element? {
        // swiftlint:disable:next force_try
        try! failableNext()
    }
}

1028 mentions a fix was merged last year, but it looks like the code is still the same. Would you please check on it?

Thanks very much!

nathanfallet commented 2 years ago

Please see #1075. It shows how you need to catch the error. Also, feel free to open a Pull Request to update the documentation to make it clearer.