Skip to content

do not replace error.message and add error.relativePath to error object #399

Closed
@jlgeering

Description

@jlgeering

this would help with notifications, e.g for gulp-notify:

plumber_options = {
  errorHandler: function(error) {
    var position = error.relativePath ? error.relativePath + ':' : 'position:';
    position += error.line ? error.line : '?';
    position += error.column ? ':' + error.column : '';
    notify({
      title: 'Task Failed [' + error.plugin + ']',
      message: error.message + '\nat ' + position,
      sound: true
    }).write(error);
    this.emit('end');
  }
};

proposed changes:

      // error.message = gutil.colors.stripColor(message);

      error.relativePath = relativePath

or maybe:

      error.originalMessage = error.message
      error.message = gutil.colors.stripColor(message);

      error.relativePath = relativePath

I can provide a patch for this highly complex change ;-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions