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

Foward ORT error messages on the C-ABI to exceptions thrown in winml #3316

Merged

Conversation

smk2007
Copy link
Member

@smk2007 smk2007 commented Mar 25, 2020

When layering was done, errors that occur on the c-abi boundary that are wrapped by OrtStatuses were not forwarded properly to winml exceptions, and only the translated HRESULT was surfaced, and not the message.

Fix: When a failing c-abi call is made, the RETURN_HR_IF_NOT_OK_MSG macro needs to set an issue an originateerror call to save the error string at the point of failure. The corresponding throw that occurs downstream needs to reuse that error message when creating the exception. This is done by calling winrt::hresult_error with from_abi_t, which will check to get the error message from there instead of clobbering it.

@smk2007 smk2007 closed this Mar 25, 2020
@smk2007 smk2007 reopened this Mar 25, 2020
@smk2007 smk2007 merged commit 51e95ea into master Mar 25, 2020
@smk2007 smk2007 deleted the user/sheilk/forward-ort-errors-to-cppwinrt-exceptions branch March 25, 2020 19:20
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

Successfully merging this pull request may close these issues.

3 participants