Skip to content

Improve error message for compiler errors on commands #167

@fhunleth

Description

@fhunleth

Here's an example:

$ ssh nerves.local 'cmd("ls")'
**Error** ** (CompileError) nofile: cannot compile file (errors have been logged)
    (elixir 1.17.2) src/elixir.erl:455: :elixir.quoted_to_erl/4
    (elixir 1.17.2) src/elixir.erl:332: :elixir.eval_forms/4
    (elixir 1.17.2) lib/module/parallel_checker.ex:112: Module.ParallelChecker.verify/1
    (elixir 1.17.2) lib/code.ex:572: Code.validated_eval_string/3
    (nerves_ssh 1.0.0) lib/nerves_ssh/exec.ex:23: NervesSSH.Exec.run/1
    (ssh 5.2.1) ssh_cli.erl:828: anonymous fn/4 in :ssh_cli.exec_in_self_group/5

The errors were logged, but it would be nice it they were returned. It would be nicer if the result looked like this:

$ ssh nerves.local 'cmd("ls")'
error: undefined function cmd/1 (there is no such import)
└─ iex:1

** (CompileError) cannot compile code (errors have been logged)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions