Skip to content

Commit

Permalink
Merge pull request #51 from operable/nmohoric/not_in_bundle
Browse files Browse the repository at this point in the history
Improve error message for missing fully qualified command
  • Loading branch information
nmohoric committed Aug 28, 2017
2 parents 3f153fc + bdb9637 commit c5c9094
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/piper/command/ast/invocation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ defmodule Piper.Command.Ast.Invocation do
throw SemanticError.new(entity, {:ambiguous, bundles})
{:error, :not_found} ->
:not_found
{:error, {:not_in_bundle, _}} ->
:not_found
{:error, {:not_in_bundle, name}} ->
throw SemanticError.new(entity, {:not_in_bundle, name})
{:error, error} ->
throw SemanticError.new(entity, error)
end
Expand Down
2 changes: 1 addition & 1 deletion test/command/parser/parser_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ defmodule Parser.ParserTest do

test "commands not in the requested bundle fail resolution" do
{:error, message} = Parser.scan_and_parse("not_in_bundle", TestHelpers.parser_options())
assert message == "Command 'not_in_bundle' not found in any installed bundle."
assert message == "Bundle 'bundle1' doesn't contain a command named 'not_in_bundle'."
end

test "splicing aliases into parse tree" do
Expand Down

0 comments on commit c5c9094

Please sign in to comment.