Closed superlopuh closed 8 years ago
Seen with @klefevre I close this one.
do / catch
is very verbose for a discutable gain of clarity / concision:
https://github.com/snipsco/Postal/pull/8/files#diff-6440425dab8a2ab45821ead162da118aR155
https://github.com/snipsco/Postal/pull/8/files#diff-ee37f775a3f9161224f5fa046c666a08R178=> These are C error codes so let's keep it simple at the moment.
A PR for making IMAPError and IMFError disappearing would however provide great API value
Just an idea for an alternative way of handling C functions that return an error code.
This PR eliminates the extensions on
Int
andInt32
for error creation, and adds a static.attempt(_:)
method toPostalErrorType
s that throws.This seems to me to be a bit more of an explicit and readable than the existing code.
WDYT?