-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[BUG]throw in def_buffer cause terminate #2764
Comments
@caishanli, can you specify why you want to throw from |
@YannickJadoul Hi, I use pybind11 to bind Tencent/ncnn. And in ncnn::Mat, the element size(in byte) can be 1, 2, 3, 4 or any other positive integers, but as my best knowledge, python have no data type of 3 bytes, 5 bytes and so on, so I need to throw a runtime error, and the same as element pack. |
@caishanli Ah, I see. And that's only known at runtime? :-( But OK, then we mainly need a way to indicate failure from a buffer, rather than a "catch all exceptions"? The latter wouldn't be wrong to do either, though. |
@YannickJadoul I think just catch all exceptions is ok as we have error message to indicate what's wrong. |
cpp
and in python
cause python terminate, output is
expected output is runtime error, not terminate
The text was updated successfully, but these errors were encountered: