lib/haibu/core/spawner.js
function onExit () {
      if (!responded) {
        errState = true;
        responded = true;
        error = new Error('Error spawning drone');
        error.blame = {
          type: 'user',
          message: 'Script prematurely exited'
        }
        error.stdout = stdout.join('\n');
        error.stderr = stderr.join('\n');
        callback(error);

        //
        // Remove listeners to related events.
        //
        drone.removeListener('error', onError);
        drone.removeListener('message', onCarapacePort);
        clearTimeout(timeout);
      }
    }
function onExit () {
      if (!responded) {
        errState = true;
        responded = true;
        error = new Error('Error spawning drone');
        error.blame = {
          type: 'user',
          message: 'Script prematurely exited'
        }
        error.stdout = stdout.join('\n');
        error.stderr = stderr.join('\n');
        callback(error);

        //
        // Remove listeners to related events.
        //
        drone.removeListener('error', onError);
        drone.removeListener('message', onCarapacePort);
        clearTimeout(timeout);
      }
    }
function onExit ( ) { if ( ! responded ) { errState = true ; responded = true ; error = new Error ( 'Error spawning drone' ) ; error . blame = { type : 'user' , message : 'Script prematurely exited' } error . stdout = stdout . join ( '\n' ) ; error . stderr = stderr . join ( '\n' ) ; callback ( error ) ; // // Remove listeners to related events. // drone . removeListener ( 'error' , onError ) ; drone . removeListener ( 'message' , onCarapacePort ) ; clearTimeout ( timeout ) ; } }
If the drone exits prematurely then respond with an error containing the data we receieved from `stderr`
If the drone exits prematurely then respond with an error containing the data we receieved from stderr