You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>The usual Node.js convention is that functions that return a <code>Promise</code> should never throw synchronously, because this forces the end user to catch eventual errors in two distrinct ways. Throwing a C++ exception in a wrapped function will automatically result in a rejected <code>Promise</code>.</p>
Currently an asynchronous wrapper will throw synchronously if it fails to parse the Javascript arguments.
It will still reject the asynchronous Promise if the underlying C/C++ method throws or if one of the check typemap fails.
This is in contrast to the usual Node.js convention that a function that returns a Promise should never throw as this forces the caller to implement two error-checking semantics.
Implementing this requires a complete overhaul of the overloading resolution and implementing typecheck typemaps which are still not supported in Javascript.
The text was updated successfully, but these errors were encountered:
swig/Doc/Manual/Javascript.html
Line 1113 in 75d9adb
Currently an asynchronous wrapper will throw synchronously if it fails to parse the Javascript arguments.
It will still reject the asynchronous
Promise
if the underlying C/C++ method throws or if one of thecheck
typemap fails.This is in contrast to the usual Node.js convention that a function that returns a
Promise
should never throw as this forces the caller to implement two error-checking semantics.Implementing this requires a complete overhaul of the overloading resolution and implementing
typecheck
typemaps which are still not supported in Javascript.The text was updated successfully, but these errors were encountered: