1.2.0
String Interpolation Convenience
ErrorKit now provides convenient string interpolation for errors, making it effortless to display user-friendly messages and debug error chains.
User-Friendly Error Messages
// Instead of:
showAlert(message: "Save failed: \(ErrorKit.userFriendlyMessage(for: error))")
// You can now simply use:
showAlert(message: "Save failed: \(error)")
Text("Could not load data: \(error)")If you were using this kind of interpolation for errors, you get improved error messages just by adding ErrorKit to your project without any changes needed! 🥳
Error Chain Debugging
// Instead of:
print("Update failed: \(ErrorKit.errorChainDescription(for: error))")
// You can now use either:
print("Update failed:\n\(chain: error)")
print("Update failed:\n\(debug: error)")Both chain: and debug: are aliases — use whichever feels more natural to you.
What's Changed
- Add StringInterpolation helpers to render errors by @finestructure in #37
New Contributors
- @finestructure made their first contribution in #37
Full Changelog: 1.1.0...1.2.0