Member-only story
Making Swift Error Messages Human-Friendly — Together
Swift error messages can be cryptic, but as a community, we can make them clearer. Help others (and your future self) by contributing better explanations.
Despite Swift’s elegant design, system error messages are often cryptic and unhelpful. Instead of just complaining, I created ErrorKit, a tool that maps these messages to human-friendly descriptions. But mapping Apple’s entire ecosystem is too big a task for one person — this needs to be a community effort.
In this post, I’ll share the foundation I’ve built for enhanced error descriptions and invite you to join me in creating a comprehensive dictionary of user-friendly error messages for Swift developers.
The Problem with System Error Messages
Let’s look at some real examples of unhelpful system error messages:
// File system error
"The file couldn't be opened because it doesn't exist."
// Better message: "The file 'report.pdf' could not be found. Please verify the file name and location."
// Core Data error
"The operation couldn't be completed. (Cocoa error 133000.)"
// Better message: "The database has a validation error. One or more required fields are empty or have…