by eemax · 7y ago · 0 comments
It re-implements a 4 line function as a 13 line class, but the logic at the caller doesn't get any simpler:
try:
result = get_user_profile(id)
except:
# handle any exceptions...
vs. with the library: result = FetchUserProfile(id)
if (result is a Failure):
# handle the failure
# do something with the resultNo comments yet.