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.
https://github.com/mmomtchev/swig/blob/75d9adb183ab375d90b51ab61bd631d442788e23/Doc/Manual/Javascript.html#L1113
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.