Hi All,
Please will the below be considered as an antipattern. I’ve trying as hard as I can to stay away from try and catch, per Mojito
docs it may return a no_return
in case of an exception. I depend on the results of this code to make a decision.
try do
case Mojito.get("endpoint") do
{:ok, response} -> response
{:error, reason} ->
Logger.error("DMC request for #{msisdn} failed with #{reason}")
nil
end
catch
type, value ->
Logger.error("DMC request for #{msisdn} failed with #{type} #{value}")
nil
end