The following exception error is thrown and will be logged to the console
TypeError: Unsupported type returned (numpy.ndarray), only pure Python types are supported.
at Promise (/Users/adammcquistan/Code/javascript/pynode/server.js:24:16)
at new Promise (<anonymous>)
at app.get (/Users/adammcquistan/Code/javascript/pynode/server.js:22:3)
at Layer.handle [as handle_request] (/Users/adammcquistan/Code/javascript/pynode/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/adammcquistan/Code/javascript/pynode/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/Users/adammcquistan/Code/javascript/pynode/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/Users/adammcquistan/Code/javascript/pynode/node_modules/express/lib/router/layer.js:95:5)
at /Users/adammcquistan/Code/javascript/pynode/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/Users/adammcquistan/Code/javascript/pynode/node_modules/express/lib/router/index.js:335:12)
at next (/Users/adammcquistan/Code/javascript/pynode/node_modules/express/lib/router/index.js:275:10)
(node:89831) UnhandledPromiseRejectionWarning: TypeError: res.err is not a function
at Promise.then.catch.err (/Users/adammcquistan/Code/javascript/pynode/server.js:36:21)
at <anonymous>
at runMicrotasksCallback (internal/process/next_tick.js:121:5)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
If an unsupported python type is encountered then throw a Nan::ThrowTypeError back up to JS
As an example, if you have a python function returning a numpy.ndarray like this
and are calling
test_numpy
from Node like thisThe following exception error is thrown and will be logged to the console