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

Error handling #17

Closed
Ariel-MN opened this issue Feb 15, 2022 · 12 comments · Fixed by #22
Closed

Error handling #17

Ariel-MN opened this issue Feb 15, 2022 · 12 comments · Fixed by #22
Assignees
Labels
enhancement New feature or request

Comments

@Ariel-MN
Copy link

There are still some Delphi components that are not supported in the Python export, such as Windows10 -> TNumberBox, if any of these components are present in the exported unit, the application does not run or trigger any errors. It would be helpful to have the cause to quickly identify the problem.

@lmbelo
Copy link
Member

lmbelo commented Feb 15, 2022

@Ariel-MN we're wrapping types and event handlers step-by-step. Can you provide all those types/events you're not able to use?

@lmbelo lmbelo self-assigned this Feb 15, 2022
@lmbelo lmbelo added the enhancement New feature or request label Feb 15, 2022
@Ariel-MN
Copy link
Author

So far I have only found the one I have described. The expected error "DelphiVCL4Python Lib is not compatible with the TNumberBox component" is not displayed.

@lmbelo
Copy link
Member

lmbelo commented Feb 15, 2022

The TNumberBox will be available in our next release. I will let you know when it is done.

@Ariel-MN
Copy link
Author

It would certainly be great, although I opened this Issue to report the absence of an error message that made me lose an hour to understand. I think this error message is quite important for those who build the GUI from Delphi and inadvertently use components that are not included in this library yet.

@lmbelo
Copy link
Member

lmbelo commented Feb 15, 2022

Are you releasing the console? The delphivcl is a dll, it will not raise the exception. You can use the console, instead.

@Ariel-MN
Copy link
Author

I am using cmd with command >> python MainForm.py

@lmbelo
Copy link
Member

lmbelo commented Feb 15, 2022

Is there a FreeConsole() command before the Application main loop (Application.Run())?

e.g.:

MyForm.Show()
-->FreeConsole()<--
Application.Run()

If does, try to remove that code and run your script again. You will be able to catch the error log on the console.

@Ariel-MN
Copy link
Author

I did it just like that, it seems errors due to non-existing components in the library are not caught.

@lmbelo
Copy link
Member

lmbelo commented Feb 24, 2022

@Ariel-MN I'm introducing a new error handling regarding Delphi run-time. I'm still running some tests, but I hope to get it working in our next release.

image

lmbelo added a commit that referenced this issue Feb 24, 2022
lmbelo added a commit that referenced this issue Feb 24, 2022
lmbelo added a commit that referenced this issue Feb 24, 2022
Releasing a patch to Error handling #17
@lmbelo
Copy link
Member

lmbelo commented Feb 24, 2022

A new Delphi run-time exception was introduced to Python. The TNumberBox wrapper was introduced as well.
The following message represents a Delphi run-time exception, emitted by Delphi to Python.

image

I'm holding for your confirmation before closing this issue.

@lmbelo lmbelo linked a pull request Feb 24, 2022 that will close this issue
@Ariel-MN
Copy link
Author

I confirm, now the name of the unrecognized classes is displayed in a console error. And as a bonus the TNumberBox component was added to the library. Thank you very much for the effort!

@lmbelo
Copy link
Member

lmbelo commented Feb 24, 2022

Thank you for confirming that it works.
I'm closing this issue once it is resolved.

@lmbelo lmbelo closed this as completed Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants