()
| 369 | } |
| 370 | |
| 371 | _callIsFinished() { |
| 372 | debug(`enter _callIsFinished(), state: ${String(this.state)}, uuid: ${this.uuid}`); |
| 373 | if (!this._checkState([IN_CALL])) return; |
| 374 | this._clearTimeout(); |
| 375 | let data, err = null; |
| 376 | try { |
| 377 | data = JSON.parse(this.outputData); |
| 378 | } catch (e) { |
| 379 | err = new Error('Error decoding PythonCaller JSON: ' + e.message); |
| 380 | } |
| 381 | if (err) { |
| 382 | this.state = EXITING; |
| 383 | this.child.kill('SIGTERM'); |
| 384 | this._callCallback(err); |
| 385 | } else { |
| 386 | this.state = WAITING; |
| 387 | if (data.present) { |
| 388 | this._callCallback(null, data.val, this.outputBoth); |
| 389 | } else { |
| 390 | this._callCallback(new FunctionMissingError('Function not found in module')); |
| 391 | } |
| 392 | } |
| 393 | debug(`exit _callIsFinished(), state: ${String(this.state)}, uuid: ${this.uuid}`); |
| 394 | } |
| 395 | |
| 396 | _errorData() { |
| 397 | const errForStack = new Error(); |
no test coverage detected