Skip to content

Commit

Permalink
Raise if Plug is missing (#446)
Browse files Browse the repository at this point in the history
Co-authored-by: Jonatan Kłosko <[email protected]>
  • Loading branch information
josevalim and jonatanklosko authored Jun 20, 2024
1 parent 4094617 commit e701ceb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/kino/proxy.ex
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ defmodule Kino.Proxy do
"""
@spec listen(plug()) :: DynamicSupervisor.on_start_child()
def listen(plug) do
unless Code.ensure_loaded?(Plug) do
raise """
Plug is required as a dependency to use Kino.Proxy. Please add the following to your Mix.install/2:
{:plug, "~> 1.16"}
"""
end

fun =
case plug do
fun when is_function(fun, 1) ->
Expand Down

0 comments on commit e701ceb

Please sign in to comment.