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...
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...
You can see the output looks again much better and now we can match on the inner error and handle it differently
You can see the output looks again much better and now we can match on the inner error and handle it differently
🔌 ConnectionError → 503 (DB unavailable)
🗄️ DatabaseError → 500 (SQL issues, invalid columns, constraints)
4xx = client mistake
5xx = server problem
Clear status codes = better API experience.
🔌 ConnectionError → 503 (DB unavailable)
🗄️ DatabaseError → 500 (SQL issues, invalid columns, constraints)
4xx = client mistake
5xx = server problem
Clear status codes = better API experience.
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...
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...