Skip to content

Commit 4bc75ee

Browse files
committed
Rescue ArgumentError when executing on remote node
1 parent f337ac6 commit 4bc75ee

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/nebulex_local_multilevel_adapter.ex

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
defmodule NebulexLocalMultilevelAdapter do
2+
require Logger
3+
24
alias Nebulex.Cache.Cluster
35
@external_resource readme = Path.join([__DIR__, "../README.md"])
46

@@ -183,7 +185,11 @@ defmodule NebulexLocalMultilevelAdapter do
183185
def execute_from_remote(cache, cache_name, fun, args) do
184186
apply(cache, :with_dynamic_cache, [cache_name, cache, fun, args])
185187
rescue
186-
Nebulex.RegistryLookupError ->
188+
e in [ArgumentError, Nebulex.RegistryLookupError] ->
189+
:error
190+
|> Exception.format(e, __STACKTRACE__)
191+
|> Logger.warning(crash_reason: {e, __STACKTRACE__})
192+
187193
:ok
188194

189195
e ->

0 commit comments

Comments
 (0)