-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
GH-35914: [MATLAB] Integrate the latest libmexclass changes to support error-handling #35918
Conversation
2. Define error message ids as static const std::string variables. Co-authored-by: Kevin Gurney <kgurney@mathworks.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Benchmark runs are scheduled for baseline = 16328f0 and contender = 4074233. 4074233 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Rationale for this change
This change integrates the latest version of
mathworks/libmexclass
into the MATLAB interface which enables throwing MATLAB errors.The 77f3d72 in
libmexclass
introduced the following changes:libmexclass::error::Error
.error
on thelibmexclass::proxy::method::Context
which is astd::optional<libmexclass::proxy::Error>
. By default, this is astd::nullopt
. To make MATLAB throw an error, set this optional.libmexclass
now requires allProxy
subclasses to define a staticmake
method:static libmexclass::proxy::MakeResult make(const libmexclass::proxy::FunctionArguments& constructor_arguments)
. This workflow is similar to using anarrow::Result<T>
object.Examples of throwing errors in MATLAB can be found on lines 45 and 94 in libmexclass/example/proxy/Car.cpp
What changes are included in this PR?
libmexclass
: 77f3d72.static libmexclass::proxy::MakeResult make(const libmexclass::proxy::FunctionArguments& constructor_arguments)
toarrow::matlab::proxy::NumericArray<Type>
.Are these changes tested?
tGateway.m
that verifieslibmexclass.proxy.gateway("Create", ...)
errors if given the name of an unknown proxy class.Are there any user-facing changes?
No.
libmexclass
changes to support error-handling #35914