From 99f581428398bea4889cfa76d33354ecc37eaa13 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Fri, 1 Mar 2024 18:01:58 -0500 Subject: [PATCH] fix: avoid false positives on is reactor check --- lib/reactor.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/reactor.ex b/lib/reactor.ex index 556198a..dd054c2 100644 --- a/lib/reactor.ex +++ b/lib/reactor.ex @@ -140,11 +140,11 @@ defmodule Reactor do def run(reactor, inputs \\ %{}, context \\ %{}, options \\ []) def run(reactor, inputs, context, options) when is_atom(reactor) do - with Reactor <- reactor.spark_is() do + if Spark.Dsl.is?(reactor, Reactor) do run(reactor.reactor(), inputs, context, options) + else + {:error, "Module `#{inspect(reactor)}` is not a Reactor module"} end - rescue - UndefinedFunctionError -> {:error, "Module `#{inspect(reactor)}` is not a Reactor module"} end def run(reactor, inputs, context, options)