libprocessing ffi error handling#1293
Conversation
catilac
left a comment
There was a problem hiding this comment.
Great! I like the error approach too. And if we ever for whatever reason needed to share more details then we can just serialize more information.
I'm approving, but also curious about what things will look like, say, if they write an erroneous compute shader.
Sorry, something went wrong.
i think we'll def run into situations like this. what i'd propose is that we write a struct ValidationResult {
error_code: u8,
data: *const c_void,
}in rust applications, you typically will bubble up on the java side, we're using unchecked exceptions. right now it's just a general "something went wrong" exception class, but we could totally add an error code in addition to message and sub-type more on the java side if we do want to throw something like |
Sorry, something went wrong.
Sets up basic bevy
Appinitialization and cross-FFI error handling.Our strategy here is the following: Java should do any validation necessary before calling into the FFI layer. Errors are assumed to be unrecoverable and evidence of us doing something wrong. So we don't return error codes or anything but just check the error status as a string so we can at least throw a helpful exception for bug reports.