You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When error occurs in Ocarina, the procedure Exit_On_Error from the file src\core\common_files\errors.adb is called.
This procedure call "OS_Exit" which works well in standalone Ocarina but stops the Python engine when used through the Python API. Then it is not possible to catch Ocarina error in Python API.
Actual procedure is:
procedure Exit_On_Error (Error : Boolean; Reason : String) is
begin
if Error then
Set_Standard_Error;
Write_Line (Reason);
OS_Exit (1);
end if;
end Exit_On_Error;
To make it work, in the Ellidiss fork, this code is changed to:
procedure Exit_On_Error (Error : Boolean; Reason : String) is
begin
if Error then
Set_Standard_Error;
-- Write_Line (Reason);
-- OS_Exit (1);
raise Ocarina_Error with Reason;
end if;
end Exit_On_Error;
And in error.ads the following line is added to define the error:
Ocarina_Error : exception;
The text was updated successfully, but these errors were encountered:
When error occurs in Ocarina, the procedure Exit_On_Error from the file src\core\common_files\errors.adb is called.
This procedure call "OS_Exit" which works well in standalone Ocarina but stops the Python engine when used through the Python API. Then it is not possible to catch Ocarina error in Python API.
Actual procedure is:
procedure Exit_On_Error (Error : Boolean; Reason : String) is
begin
if Error then
Set_Standard_Error;
Write_Line (Reason);
OS_Exit (1);
end if;
end Exit_On_Error;
To make it work, in the Ellidiss fork, this code is changed to:
procedure Exit_On_Error (Error : Boolean; Reason : String) is
begin
if Error then
Set_Standard_Error;
-- Write_Line (Reason);
-- OS_Exit (1);
raise Ocarina_Error with Reason;
end if;
end Exit_On_Error;
And in error.ads the following line is added to define the error:
Ocarina_Error : exception;
The text was updated successfully, but these errors were encountered: