Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Python stop python engine on ocarina error #37

Closed
Ellidiss opened this issue Jun 4, 2015 · 0 comments
Closed

API Python stop python engine on ocarina error #37

Ellidiss opened this issue Jun 4, 2015 · 0 comments
Assignees

Comments

@Ellidiss
Copy link
Contributor

Ellidiss commented Jun 4, 2015

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;

yoogx added a commit that referenced this issue Jun 5, 2015
@yoogx yoogx closed this as completed Jun 5, 2015
@yoogx yoogx self-assigned this Jun 5, 2015
yoogx added a commit that referenced this issue Jun 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant