diff --git a/otherlibs/site/src/plugins/linker/toplevel/linker.ml b/otherlibs/site/src/plugins/linker/toplevel/linker.ml index 563590db4366..3001b70181e8 100644 --- a/otherlibs/site/src/plugins/linker/toplevel/linker.ml +++ b/otherlibs/site/src/plugins/linker/toplevel/linker.ml @@ -1 +1,10 @@ -let load = Topdirs.dir_load Format.err_formatter +let load filename = + let buf = Buffer.create 16 in + let ppf = Format.formatter_of_buffer buf in + match Toploop.load_file ppf filename with + | true -> () + | false -> + Format.pp_print_flush ppf (); + failwith + @@ Format.asprintf "Failed to load file `%s': %s" filename + (Buffer.contents buf)