From 9cb14c8dd123fda3962b59c1e1c832b87c4cfdea Mon Sep 17 00:00:00 2001 From: Ivan Bondarev Date: Mon, 10 Jun 2024 20:59:03 +0200 Subject: [PATCH] #3127 --- Compiler/Compiler.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Compiler/Compiler.cs b/Compiler/Compiler.cs index 54331365f..3c97424ae 100644 --- a/Compiler/Compiler.cs +++ b/Compiler/Compiler.cs @@ -3366,8 +3366,18 @@ namespace PascalABCCompiler // It's not always possible to solve by re-ordering the references, since there are cases of // mutually-dependent assemblies (i.e. dependency loops) in the wild. foreach (var reference in referenceDirectives) - PreloadReference(reference); - + { + try + { + PreloadReference(reference); + } + catch (FileLoadException ex) + { + throw new CommonCompilerError(ex.Message, compilationUnit.SyntaxTree.file_name, reference.location.begin_line_num, reference.location.end_line_num); + } + } + + foreach (var reference in referenceDirectives) CompileReference(dlls, reference);