Skip to content

Releases: FlineDev/ErrorKit

1.2.1

04 Jun 11:03
Compare
Choose a tag to compare

Adding Logger Conveniences

Since string interpolation (added in 1.2.0) only works where a String is expected, the last release doesn't help with Logger where OSLogMessage is expected. This version introduces convenience APIs so the errorChainDescription can be easily printed in those cases.

For OSLog/Logger there are now dedicated convenience overloads taking a second error parameter:

// Instead of:
Logger().error("Update failed:\n\(ErrorKit.errorChainDescription(for: error))")

// You can simply use overloads like:
Logger().error("Update failed", error: error)
Logger().warning("Update failed", error: error)

Note that there's no need to add a colon (:) or newline (\n) to the message, they will be added automatically.

Full Changelog: 1.2.0...1.2.1

1.2.0

04 Jun 07:45
Compare
Choose a tag to compare

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

New Contributors

Full Changelog: 1.1.0...1.2.0

1.1.0

03 May 06:16
2c1aa89
Compare
Choose a tag to compare

What's Changed

  • Add an async variant to Catching.catch by @jubishop in #34
  • Add ErrorMapper protocol for registering custom error mappers by @Jeehut in #35 (thanks to @Sherlouk for the idea!)

New Contributors

Full Changelog: 1.0.1...1.1.0

1.0.1

27 Apr 04:00
2834168
Compare
Choose a tag to compare

What's Changed

  • Add privacy manifest file to make clear no data being tracked by @Jeehut in #31

Full Changelog: 1.0.0...1.0.1

1.0.0

18 Apr 16:17
Compare
Choose a tag to compare

Initial release! 🎉