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

Completion of error handling #15

Closed
elfring opened this issue Mar 21, 2019 · 4 comments
Closed

Completion of error handling #15

elfring opened this issue Mar 21, 2019 · 4 comments

Comments

@elfring
Copy link

elfring commented Mar 21, 2019

Would you like to add more error handling for return values from functions like the following?

@SanderMertens
Copy link
Owner

Yes, definitely. Since I have your ear, I'd like to do a more comprehensive review of error handling. Today the API asserts when there is an error, and you get the file + line where the assert happened. Often that is sort of useful, but you don't really know where the error happened in your app code.

I'd like to move the actual assert to a macro that wraps the API, so that the assert reports the location in the application code, not in the library. That could make it much easier to debug things, as I don't need another tool to obtain the stack trace to see where it happened. Additionally, if you would use the "unwrapped" API, you'd have an API that never asserts, so you kind of have the best of both worlds.

Anyway, that's just an idea I thought would make life a little bit easer. Curious to hear what people think.

@elfring
Copy link
Author

elfring commented Mar 22, 2019


How do you think about to improve static source code analysis also for this software?


@SanderMertens
Copy link
Owner

@elfring Ok, I will reconsider that. For now, I will stick with the current approach, and address the issues you identified.

@SanderMertens
Copy link
Owner

I added a more complete description of error handling here: https://github.com/SanderMertens/flecs/blob/master/Manual.md

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

No branches or pull requests

2 participants