Skip to content

Commit

Permalink
Use NimbleOwnership.Error
Browse files Browse the repository at this point in the history
  • Loading branch information
whatyouhide committed Dec 26, 2023
1 parent fe5a6c2 commit 2d6439f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/nimble_ownership.ex
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ defmodule NimbleOwnership do

case state.allowances[pid_to_allow][key] do
%{owner_pid: other_owner_pid} when other_owner_pid != owner_pid ->
{:reply, {:error, {:already_allowed, other_owner_pid}}, state}
error = %NimbleOwnership.Error{reason: {:already_allowed, other_owner_pid}}
{:reply, {:error, error}, state}

_other ->
state =
Expand Down

0 comments on commit 2d6439f

Please sign in to comment.