The success type of the function does not match the callback type in the behaviour.
defmodule ExampleBehaviour do @callback ok() :: :ok end defmodule Example do @behaviour ExampleBehaviour def ok() do :error end end