File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -461,7 +461,7 @@ defmodule Nebulex.Cache.Options do
461461 behaviour ->
462462 msg =
463463 "#{ target } expects the option value #{ inspect ( value ) } " <>
464- "to list #{ inspect ( behaviour ) } as a behaviour"
464+ "to list #{ inspect ( behaviour ) } as a behaviour" <> behaviour_hint ( behaviour )
465465
466466 { :error , msg }
467467 end
@@ -472,6 +472,17 @@ defmodule Nebulex.Cache.Options do
472472 { :error , "expected a module, got: #{ inspect ( value ) } " }
473473 end
474474
475+ # Nebulex v3.1 made Nebulex.Adapter.CompositeKV mandatory, so an adapter
476+ # built for v3.0 fails here; tell the user how to fix it
477+ defp behaviour_hint ( Nebulex.Adapter.CompositeKV ) do
478+ ". Add `use Nebulex.Adapter.CompositeKV` to the adapter, " <>
479+ "or upgrade it to a version built for Nebulex v3.1 or later"
480+ end
481+
482+ defp behaviour_hint ( _behaviour ) do
483+ ""
484+ end
485+
475486 ## Extras
476487
477488 @ doc """
Original file line number Diff line number Diff line change @@ -86,7 +86,9 @@ defmodule Nebulex.Cache.SupervisorTest do
8686 msg =
8787 "invalid value for :adapter option: Nebulex.Cache expects the option value " <>
8888 "Nebulex.Cache.SupervisorTest.NoCompositeKVAdapter to list " <>
89- "Nebulex.Adapter.CompositeKV as a behaviour"
89+ "Nebulex.Adapter.CompositeKV as a behaviour. Add " <>
90+ "`use Nebulex.Adapter.CompositeKV` to the adapter, or upgrade it to " <>
91+ "a version built for Nebulex v3.1 or later"
9092
9193 assert_raise NimbleOptions.ValidationError , msg , fn ->
9294 defmodule NoCompositeKVAdapter do
You can’t perform that action at this time.
0 commit comments