@@ -331,6 +331,8 @@ struct PkgPrecompileError <: Exception
331331 msg:: String
332332end
333333Base. 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+
334336# This needs a show method to make `julia> err` show nicely
335337Base. show (io:: IO , err:: PkgPrecompileError ) = print (io, " PkgPrecompileError: " , err. msg)
336338
@@ -812,7 +814,7 @@ function precompilepkgs(pkgs::Vector{String}=String[];
812814 close (std_pipe. in) # close pipe to end the std output monitor
813815 wait (t_monitor)
814816 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 , " " ))) : " "
816818 delete! (std_outputs, pkg_config) # so it's not shown as warnings, given error report
817819 ! fancyprint && lock (print_lock) do
818820 println (io, " " ^ 9 , color_string (" ✗ " , Base. error_color ()), name)
@@ -935,7 +937,7 @@ function precompilepkgs(pkgs::Vector{String}=String[];
935937 end
936938 else
937939 println (io)
938- error ( err_msg)
940+ throw ( PkgPrecompileError ( err_msg) )
939941 end
940942 end
941943 end
0 commit comments