-
Notifications
You must be signed in to change notification settings - Fork 465
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
Error was ignored if ThreadSafeFunction::GetContext()
failed
#581
Comments
Hi team, I can start work on this if nobody has? (direct ping to @legendecas since he reported this) |
@KevinEady You have it. :P |
Started working on this and I have some questions here. Specifically, since inline ThreadSafeFunction::ConvertibleContext
ThreadSafeFunction::GetContext() const {
void* context;
napi_status status = napi_get_threadsafe_function_context(*_tsfn, &context);
NAPI_FATAL_IF_FAILED(status, "ThreadSafeFunction::GetContext", "napi_get_threadsafe_function_context");
return ConvertibleContext({ context });
} This works, but as a fatal error, will end the process, and does not allow a way for the caller to catch this error -- with Any suggestions? |
I think aborting would be just fine. Since we don't expect any error on this method. Neither do we have any recover solution on the error situation. |
Looking at the implementation, |
Currently
napi_status
was ignored inThreadSafeFunction::GetContext()
. Nonapi_status
shall be ignored as it would unstablize the behavior we'd expect.Since the function signature doesn't support error returning, an alternative might be aborting on non-
napi_ok
statuses.Originally posted by @legendecas in #546
The text was updated successfully, but these errors were encountered: