diff --git a/stdlib/Pkg/src/GraphType.jl b/stdlib/Pkg/src/GraphType.jl index 35bb07f8eecdc3..e2af668c964068 100644 --- a/stdlib/Pkg/src/GraphType.jl +++ b/stdlib/Pkg/src/GraphType.jl @@ -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 @@ -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 diff --git a/stdlib/Pkg/src/REPLMode.jl b/stdlib/Pkg/src/REPLMode.jl index b217b663ffd299..ba4ad0c78f54b9 100644 --- a/stdlib/Pkg/src/REPLMode.jl +++ b/stdlib/Pkg/src/REPLMode.jl @@ -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 # @@ -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