The following code in rabbitmq/ra:
case catch ra_server_sup_sup:restart_server(System, ServerId, #{}) of
{ok, _} -> ok;
{ok, _, _} -> ok;
{error, _} = Err -> Err;
{badrpc, Reason} -> {error, Reason};
{'EXIT', Err} -> {error, Err}
end.
fails with:
The pattern {'EXIT', Err} on line 179 at column 9 doesn't have the type {error, system_not_started} | {error, startchild_err()}
even though it's clear that the {'EXIT', Err} pattern is there to handle the result added by a call protected with catch.
The following code in rabbitmq/ra:
fails with:
even though it's clear that the
{'EXIT', Err}pattern is there to handle the result added by a call protected withcatch.