Skip to content

Commit

Permalink
show resolver error without backtrace in repl mode (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed May 29, 2018
1 parent d67e336 commit 7f1a8bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions stdlib/Pkg/src/GraphType.jl
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ function check_constraints(graph::Graph)
err_msg = "Resolve failed to satisfy requirements for package $(id(p0)):\n"
end
err_msg *= sprint(showlog, rlog, pkgs[p0])
throw(ResolverError(err_msg))
throw(ResolverError(chomp(err_msg)))
end
return true
end
Expand Down Expand Up @@ -1002,7 +1002,7 @@ function propagate_constraints!(graph::Graph, sources::Set{Int} = Set{Int}(); lo
err_msg = "Resolve failed to satisfy requirements for package $(id(p1)):\n"
end
err_msg *= sprint(showlog, rlog, pkgs[p1])
throw(ResolverError(err_msg))
throw(ResolverError(chomp(err_msg)))
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions stdlib/Pkg/src/REPLMode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ using UUIDs
import REPL
import REPL: LineEdit, REPLCompletions

import ..devdir, ..API
using ..Types, ..Display, ..Operations
import ..devdir
using ..Types, ..Display, ..Operations, ..API

############
# Commands #
Expand Down Expand Up @@ -236,8 +236,8 @@ function do_cmd(repl::REPL.AbstractREPL, input::String; do_rethrow=false)
if do_rethrow
rethrow(err)
end
if err isa CommandError
Base.display_error(repl.t.err_stream, ErrorException(err.msg), Ptr{Nothing}[])
if err isa CommandError || err isa ResolverError
Base.display_error(repl.t.err_stream, ErrorException(sprint(showerror, err)), Ptr{Nothing}[])
else
Base.display_error(repl.t.err_stream, err, Base.catch_backtrace())
end
Expand Down

0 comments on commit 7f1a8bf

Please sign in to comment.