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

Fix unsecured asynchronous execution of coroutines with GDRx-Try-Catch #20

Open
Neroware opened this issue May 12, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@Neroware
Copy link
Owner

The ErrorHandler is not asynchronous meaning it breaks when a coroutine is used within a GDRx-Try-Catch-object. I recommend using a disposable to maintain information on the current error-handling frame, which is inserted into the risky function like this:

GDRx.try(func(frame) ... await foo ...).catch("Error", func(e): ...).end_try_catch()

This should make it possible to keep information on the handled errors for as long as the coroutine is running.

@Neroware Neroware added the bug Something isn't working label May 12, 2024
@Neroware Neroware self-assigned this May 12, 2024
@Neroware
Copy link
Owner Author

Welp, I think this actually might be technically impossible using only GDScript. We cannot get any information on the current call stack and the currently running callable in control flow. (I know, there are methods that print stack info, but these are only for debugging). Suggestions would be welcome, otherwise I do not know if this is not impossible...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant