Closed themasch closed 10 years ago
Exceptions must not leak into C code. As long as that doesn't happen, sure.
The eventual C code should probably populate struct passed in by pointer, and return error codes, or something.
Since we're writing C++ here, I think exceptions are only sensible.
It is the responsibility of the C wrapper to ensure that there are no leakages - which it might have to do anyway, since we're calling library functions that can throw.
@lukegb +1
so i'm counting 3:0 for exceptions? Great!
@satan6 your thoughts?
Yeah, exceptions are good. +1
Discussion closed, core devs decided pro exceptions. pls reopen if you got good reason AGAINST exceptions.
I feel like we need a proper way to deal with situations like this: https://github.com/loldevs/libOL/blob/master/src/libOL/Blocks/Block.cpp#L48
I think everyone know that exit(1) isn't a proper error handling for library code ;) we never ever should terminate the process. I think thats exactly what exceptions are invented for and we should use them. Same goes for asserts.
What do you guys thing? If we want to be able to write bindings for other languages soon we need a way to take care of errors that is not "terminate the process". Some day our library might become part of a webservice and it kind of sucks if your workers die because our parse isn't happy ;)
TL;DR: +1 for exception all over the place