From 2d6439f22bb330766d670f2df20a3b2e73d09952 Mon Sep 17 00:00:00 2001 From: Andrea Leopardi Date: Tue, 26 Dec 2023 18:12:42 +0100 Subject: [PATCH] Use NimbleOwnership.Error --- lib/nimble_ownership.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/nimble_ownership.ex b/lib/nimble_ownership.ex index 0af5056..bb448ca 100644 --- a/lib/nimble_ownership.ex +++ b/lib/nimble_ownership.ex @@ -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 =