Closed LogikMeister closed 1 year ago
1.0.5
python ... def hello() rasie Exception('error') return 'hello from python' js appModule.call('hello', [], (data) => { consolo.log(data) }, (err) => { console.log(err) } ) Error node process exit with code 1
python
... def hello() rasie Exception('error') return 'hello from python'
js
appModule.call('hello', [], (data) => { consolo.log(data) }, (err) => { console.log(err) } )
python import nodepyrunner ... try: nodepyrunner.callJs(target='hello', args=[]) except: print('some err') js global.hello = () => { throw Error() } Error FATAL ERROR: Error::New napi_get_last_error_info 1: 00007FF7E15FB34F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+123599 2: 00007FF7E1588CB6 v8::internal::MicrotaskQueue::GetMicrotasksScopeDepth+65206 3: 00007FF7E1589D8D node::OnFatalError+301 4: 00007FF7E1589369 v8::internal::MicrotaskQueue::GetMicrotasksScopeDepth+66921 5: 00007FF7E15B73FC napi_fatal_error+156 ...
import nodepyrunner ... try: nodepyrunner.callJs(target='hello', args=[]) except: print('some err')
global.hello = () => { throw Error() }
FATAL ERROR: Error::New napi_get_last_error_info 1: 00007FF7E15FB34F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+123599 2: 00007FF7E1588CB6 v8::internal::MicrotaskQueue::GetMicrotasksScopeDepth+65206 3: 00007FF7E1589D8D node::OnFatalError+301 4: 00007FF7E1589369 v8::internal::MicrotaskQueue::GetMicrotasksScopeDepth+66921 5: 00007FF7E15B73FC napi_fatal_error+156 ...
Node process ended because of python and javascript throw error. Python和JavaScript抛出异常都会导致node进程结束。