#DatabaseError
This is what proper error debugging can look like in #Swift 6:

AppError
└─ ProfileError
└─ DatabaseError
└─ FileError.notFound(path: "/Users/data.db")

Learn how to achieve this full error chain visibility in your apps with a simple protocol!
#Debugging #iOSDev
www.fline.dev/swift-6-type...
www.fline.dev
May 2, 2025 at 2:22 PM
Let's define a custom error type instead of simple strings. The idea is simple, we create a DatabaseError enum and we modify the get_student function to return the appropriate variants.

You can see the output looks again much better and now we can match on the inner error and handle it differently
March 6, 2025 at 8:05 AM
We also handle:

🔌 ConnectionError → 503 (DB unavailable)
🗄️ DatabaseError → 500 (SQL issues, invalid columns, constraints)

4xx = client mistake
5xx = server problem

Clear status codes = better API experience.
March 1, 2026 at 7:55 PM
is this something? python-like `except` that asserts Error(s) and bubbles up unexpected ones. some fancy type-narrowing as well...
January 7, 2025 at 1:38 AM
SwiftUI makes it easy to implement validation logic for forms directly in the view.

But you know what’s better than that? Enforcing validation directly in the database so that every view shares the same validation logic. SQL triggers make this extremely easy!

👉 www.pointfree.co/episodes/ep3...
July 22, 2025 at 5:02 PM