Try catch antipattern

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

This is strange, because get does delegate to request, which does not have no_result as return value.

I made a mistake, no_return instead of no_result, I’ve edited my earlier post. Will you consider the above as an anti-pattern if I’m wrap that block in a try and catch. Thanks.

If you don’t want an exception to propagate then that’s the way to handle it.

A no_reply value usually indicates a big in a function and dialyzer insists that it won’t return a real value.

If you are calling a non-bang function that returns a success tuple there shouldn’t be any reason to rescue or catch an error.