Skip to content

Commit 72c66f2

Browse files
wildarttkelman
authored andcommitted
fixed error in LibGit2.merge! when a branch does not have a remote (#15937)
* fixed merge error when branch does not have remote fixed error in an exception message creation when exception isn't GitError (Found it while looked at #14616) testing LibGit2.merge! exceptions removed changes in original message fixed #13991, rethrowing uknown errors defer exceptions until update end moved statement to avoid contamination of backtrace * fixed similar error in `rebase!`, fixed typos * Separate internal API and Pkg UI commands by using `PkgError` `PkgError` becomes an information error that would keep underlying exceptions `CapturedException` should have supertype `Exception` * Put off `Cache.prefetch` exceptions in `Pkg.update` * enable `fetch` exceptions, nice `PkgError` output * fix possible undefined behavior (ref pull/14146) * fixed indentations
1 parent 994c15b commit 72c66f2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

base/pkg.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,23 @@ const META_BRANCH = "metadata-v2"
1111

1212
type PkgError <: Exception
1313
msg::AbstractString
14+
ex::Nullable{Exception}
15+
end
16+
PkgError(msg::AbstractString) = PkgError(msg, Nullable{Exception}())
17+
function Base.showerror(io::IO, pkgerr::PkgError)
18+
print(io, pkgerr.msg)
19+
if !isnull(pkgerr.ex)
20+
pkgex = get(pkgerr.ex)
21+
if isa(pkgex, CompositeException)
22+
for cex in pkgex
23+
print(io, "\n=> ")
24+
showerror(io, cex)
25+
end
26+
else
27+
print(io, "\n")
28+
showerror(io, pkgex)
29+
end
30+
end
1431
end
1532

1633
for file in split("dir types reqs cache read query resolve write entry git")

0 commit comments

Comments
 (0)