@@ -331,6 +331,8 @@ struct PkgPrecompileError <: Exception
331
331
msg:: String
332
332
end
333
333
Base. showerror (io:: IO , err:: PkgPrecompileError ) = print (io, err. msg)
334
+ Base. showerror (io:: IO , err:: PkgPrecompileError , bt; kw... ) = Base. showerror (io, err) # hide stacktrace
335
+
334
336
# This needs a show method to make `julia> err` show nicely
335
337
Base. show (io:: IO , err:: PkgPrecompileError ) = print (io, " PkgPrecompileError: " , err. msg)
336
338
@@ -812,7 +814,7 @@ function precompilepkgs(pkgs::Vector{String}=String[];
812
814
close (std_pipe. in) # close pipe to end the std output monitor
813
815
wait (t_monitor)
814
816
if err isa ErrorException || (err isa ArgumentError && startswith (err. msg, " Invalid header in cache file" ))
815
- failed_deps[pkg_config] = (strict || is_direct_dep) ? string (sprint (showerror, err), " \n " , strip (get (std_outputs, pkg , " " ))) : " "
817
+ failed_deps[pkg_config] = (strict || is_direct_dep) ? string (sprint (showerror, err), " \n " , strip (get (std_outputs, pkg_config , " " ))) : " "
816
818
delete! (std_outputs, pkg_config) # so it's not shown as warnings, given error report
817
819
! fancyprint && lock (print_lock) do
818
820
println (io, " " ^ 9 , color_string (" ✗ " , Base. error_color ()), name)
@@ -935,7 +937,7 @@ function precompilepkgs(pkgs::Vector{String}=String[];
935
937
end
936
938
else
937
939
println (io)
938
- error ( err_msg)
940
+ throw ( PkgPrecompileError ( err_msg) )
939
941
end
940
942
end
941
943
end
0 commit comments