MCPcopy Index your code
hub / github.com/PrairieLearn/PrairieLearn / _handleChildError

Method _handleChildError

lib/code-caller.js:323–342  ·  view source on GitHub ↗
(error)

Source from the content-addressed store, hash-verified

321 }
322
323 _handleChildError(error) {
324 debug(`enter _handleChildError(), state: ${String(this.state)}, uuid: ${this.uuid}`);
325 this._checkState([WAITING, IN_CALL, EXITING]);
326 if (this.state == WAITING) {
327 this._logError('PythonCaller child process raised error while in state = WAITING, message = ' + String(error));
328 this.state = EXITING;
329 this.child.kill('SIGTERM');
330 } else if (this.state == IN_CALL) {
331 this._logError('PythonCaller child process raised error while in state = IN_CALL, message = ' + String(error));
332 this._clearTimeout();
333 this.state = EXITING;
334 this.child.kill('SIGTERM');
335 const err = new Error('PythonCaller child process error: ' + String(error));
336 this._callCallback(err);
337 } else if (this.state == EXITING) {
338 this._logError('PythonCaller child process raised error while in state = EXITING, message = ' + String(error));
339 }
340 this._checkState();
341 debug(`exit _handleChildError(), state: ${String(this.state)}, uuid: ${this.uuid}`);
342 }
343
344 _timeout() {
345 debug(`enter _timeout(), state: ${String(this.state)}, uuid: ${this.uuid}`);

Callers

nothing calls this directly

Calls 5

_checkStateMethod · 0.95
_logErrorMethod · 0.95
_clearTimeoutMethod · 0.95
_callCallbackMethod · 0.95
debugFunction · 0.85

Tested by

no test coverage detected