node_modules/contentful-batch-libs/dist/listr.js
// Set up log emitter listening from SDK, proper error catching and throwing of SDK errors
Set up log emitter listening from SDK, proper error catching and throwing of SDK errors
Set up log emitter listening from SDK proper error catching and throwing of SDK errors
function wrapTask(func) {
  return function (ctx, task) {
    var teardownTaskListeners = (0, _logging.logToTaskOutput)(task);
    return func(ctx, task).then(function () {
      teardownTaskListeners();
    }).catch(function (error) {
      teardownTaskListeners();
      var formattedMessage = (0, _logging.formatLogMessageOneLine)({
        ts: new Date().toJSON(),
        level: 'error',
        error
      });
      var enrichedError = new Error(formattedMessage);
      enrichedError.originalError = error;
      throw enrichedError;
    });
  };
}
function wrapTask ( func ) { return function ( ctx , task ) { var teardownTaskListeners = ( 0 , _logging . logToTaskOutput ) ( task ) ; return func ( ctx , task ) . then ( function ( ) { teardownTaskListeners ( ) ; } ) . catch ( function ( error ) { teardownTaskListeners ( ) ; var formattedMessage = ( 0 , _logging . formatLogMessageOneLine ) ( { ts : new Date ( ) . toJSON ( ) , level : 'error' , error } ) ; var enrichedError = new Error ( formattedMessage ) ; enrichedError . originalError = error ; throw enrichedError ; } ) ; } ; }
Set up log emitter listening from SDK, proper error catching and throwing of SDK errors
Set up log emitter listening from SDK proper error catching and throwing of SDK errors
// Format message as human readable listr output // Attach original error object for error log