Skip to content

Commit 2a37eb2

Browse files
committed
W403-001 Fixing project loading error notification
Exception information is also added to the notification to make it useful.
1 parent b680e31 commit 2a37eb2

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

source/ada/lsp-ada_handlers.adb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4915,17 +4915,20 @@ package body LSP.Ada_Handlers is
49154915
else
49164916
Create_Context_For_Non_Aggregate (Self.Project_Tree.Root_Project);
49174917
end if;
4918+
49184919
exception
4919-
when E : Invalid_Project =>
4920+
when E : others =>
49204921
Self.Release_Contexts_And_Project_Info;
49214922

49224923
Self.Trace.Trace (E);
49234924
Errors.a_type := LSP.Messages.Error;
49244925

4925-
Errors.message.Append
4926-
(VSS.Strings.Conversions.To_Virtual_String
4927-
("Unable to load project file: " &
4928-
String (GPR.Full_Name.all) & Ada.Characters.Latin_1.LF));
4926+
On_Error
4927+
("Unable to load project file: " &
4928+
String (GPR.Full_Name.all) & Ada.Characters.Latin_1.LF);
4929+
On_Error
4930+
(Ada.Exceptions.Exception_Message (E) &
4931+
Ada.Characters.Latin_1.LF);
49294932

49304933
-- The project was invalid: fallback on loading the implicit
49314934
-- project.

0 commit comments

Comments
 (0)