From d17746740cfdff0c408f8bf7e4f1dd75ab08c37c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Niemier?= Date: Fri, 12 Oct 2018 01:34:01 +0200 Subject: [PATCH] Handle case when process already ended As there is no way to differentiate between "already ended" and "never existed" PIDs it will return `:ok` even when provided never-existing PID. --- lib/imager/runner.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/imager/runner.ex b/lib/imager/runner.ex index 40f447b..324cc61 100644 --- a/lib/imager/runner.ex +++ b/lib/imager/runner.ex @@ -36,6 +36,7 @@ defmodule Imager.Runner do receive do {:DOWN, ^ref, :process, ^pid, :normal} -> :ok + {:DOWN, ^ref, :process, ^pid, :noproc} -> :ok {:DOWN, ^ref, :process, ^pid, _} -> :error end end