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

Throw exception when failing to read from message. #144

Open
titusio opened this issue Jul 31, 2024 · 2 comments
Open

Throw exception when failing to read from message. #144

titusio opened this issue Jul 31, 2024 · 2 comments
Labels
Feature Request New feature or request

Comments

@titusio
Copy link
Contributor

titusio commented Jul 31, 2024

As my projects gets bigger, it becomes hard to find the spot where a message reading operation fails. For debug purposes, it could be helpful to throw an exception so IDEs can help debugging the code.
I think a static bool in the Message class like throwReadException could enable debug builds to throw exceptions while leaving release builds untouched.

@tom-weiland tom-weiland added the Feature Request New feature or request label Jul 31, 2024
@tom-weiland
Copy link
Collaborator

I didn't do this because throwing an exception would be a serious and easily exploitable vulnerability that could allow someone to intentionally crash your server. Also, if you're using Unity the error log should contain the full stack trace, no?

However, you have a point that this could be made conditional for debugging purposes—although I'd recommend using conditional compilation (#if RIPTIDE_DEBUG or something) instead of a static property like you suggested.

That being said, I'm no longer actively working on Riptide so it would be up to you (or someone else) to implement it and make a PR.

@titusio
Copy link
Contributor Author

titusio commented Aug 1, 2024

I never thought about the implied security risks but I like the #if idea. If I find some time, I'll add this if I find some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants