Skip to content

Safe execute method #812

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

Merged
merged 3 commits into from
Oct 16, 2018
Merged

Conversation

Kaladrius2trip
Copy link
Contributor

No description provided.

@ghost ghost added the needs review label Oct 16, 2018
@sschmid
Copy link
Owner

sschmid commented Oct 16, 2018

Hi, thanks for you PR.
But I have to say that I think that this is a bad idea.
This change basically hides exceptions and doesn't fail. This will make it impossible to scale up your game. My motto: crash hard and early. Otherwise you cannot fix the actual bugs and you will have unexpected follow up errors that potentially doesn't have anything to do with the original exception.

There are use-cases where it's valid to silently catch exceptions, but not in the reactive system.

@Kaladrius2trip
Copy link
Contributor Author

Kaladrius2trip commented Oct 16, 2018

I have some problem in my project when i don't handle exception in some reactive system.
But i have many exceptions in loop.
IMHO: Logs contain many EntityIsAlreadyRetainedByOwnerException errors but real useful information contains in first one from my code base.
TryFinaly block hide only this exception in reactive system, but my error it still actual and i should see only one error but i saw more than expected. And i think any framework must be safe from a box. And my Exception it is my problem.

@ghost ghost removed the needs review label Oct 16, 2018
@sschmid sschmid reopened this Oct 16, 2018
@ghost ghost assigned sschmid Oct 16, 2018
@ghost ghost added the needs review label Oct 16, 2018
@sschmid
Copy link
Owner

sschmid commented Oct 16, 2018

Ah, I understand now. It's not catching the exception, it just prevents the followup exception EntityIsAlreadyRetainedByOwnerException not spam the console. I have to correct myself then, this is a good idea. Sorry, I initially though it's just catching the exception, which obviously wouldn't be such a great idea.
Thanks for clearing things up! 👍
Will be in the next release

@sschmid sschmid merged commit a812509 into sschmid:develop Oct 16, 2018
@ghost ghost removed the needs review label Oct 16, 2018
@Kaladrius2trip
Copy link
Contributor Author

Thanks for you work!

@Kaladrius2trip Kaladrius2trip deleted the feature/try_finaly branch October 16, 2018 20:04
@optimisez
Copy link

@sschmid Is that possible to implement this similar feature without using any Exception Handling statements (try-finally for this PR)? From what I understand, it will have performance penalty when using Exception Handling statements.

@Kaladrius2trip
Copy link
Contributor Author

@optimisez It low cost operation. For my project thar solve many problem for debugging and handle exception. In the world-wide we may find many tests for using try-finally blocks.
For example stackoverflow.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants