alco / porcelain

Work with external processes like a boss

Home Page:http://hexdocs.pm/porcelain

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error condition not properly documented for Porcelain.spawn

sudeepdino008 opened this issue · comments

For some cases, Porcelain.spawn returns data of structure {:error, <reason>}. E.g:

iex(23)> Porcelain.spawn("whoami2", [])
{:error, "Command not found: whoami2"}

But the spec doesn't capture it:

@spec spawn(binary, [binary])            :: Porcelain.Process.t
  @spec spawn(binary, [binary], Keyword.t) :: Porcelain.Process.t

  def spawn(prog, args, options \\ [])

leading to little annoyances like warning messages about pattern matching with the error msg type.