fix: try-case-of rather than try-of
try-of catches only what happens within but not after
This commit is contained in:
parent
965236c888
commit
b7e3f9d5a6
|
@ -266,11 +266,13 @@ code_change(_OldVsn, State, _Extra) ->
|
|||
|
||||
%%==============================================================================
|
||||
-define(PICK(ID, KEY, PID, EXPR),
|
||||
try gproc_pool:pick_worker(ID, KEY) of
|
||||
try
|
||||
case gproc_pool:pick_worker(ID, KEY) of
|
||||
PID when is_pid(PID) ->
|
||||
EXPR;
|
||||
_ ->
|
||||
?RESOURCE_ERROR(worker_not_created, "resource not created")
|
||||
end
|
||||
catch
|
||||
error:badarg ->
|
||||
?RESOURCE_ERROR(worker_not_created, "resource not created");
|
||||
|
|
Loading…
Reference in New Issue