A functional abstraction of rescuing exceptions inspired by Scala's Try class