I was writing a package that retrieved data from various sources in order to use it in computations when I realized it would be practical to have a simple method of error handling.
Ideally, I would like to be able to write
Print["Message"]; Return[<|"Success" -> False|>]
Return[<|"Success" -> True, "Return" -> return|>]
However, I am struggling as how to implement this in Mathematica. Clearly, one can't make use of
SetDelayed because then
Return would relate to the wrong function. Is there a way around?