Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Priority and icon in onError #69

Open
Evaske opened this issue Feb 17, 2015 · 3 comments
Open

Priority and icon in onError #69

Evaske opened this issue Feb 17, 2015 · 3 comments

Comments

@Evaske
Copy link

Evaske commented Feb 17, 2015

Hey,

I'm trying to get an icon and priority set in the onError but can't seem to get it to work no matter what I try.

.on("error", plugins.notify.onError({
        message: "<%= error.message %>",
        title: "Error Compiling",
        priority: 10,
        "icon": path.join(__dirname, 'node_modules/gulp-notify/assets', 'gulp.png')
    }))

This code works if it is a normal notify message but not if it is being done as an error. Am I doing something wrong to allow me to set the priority and icon for an error message?

Or even just the inverted icon like I've seen should happen on an error. That isn't showing for me. I'm using Snarl on Windows 7.

@jpcmf
Copy link

jpcmf commented Feb 18, 2015

I have a similar problem using gulp-ruby-sass and gulp-notify. The error message don't appear anymore only the success message.

@mikaelbr
Copy link
Owner

@Evaske The notification works, but the icon and priority doesn't? And this happens only onError?

Could you try printing out options on this line: https://github.com/mikaelbr/gulp-notify/blob/master/lib/report.js#L32 To see if all options are set correctly.

@Evaske
Copy link
Author

Evaske commented Mar 23, 2015

@mikaelbr Yes the notification works but there is no icon and priority doesn't seem to get set, it just shows as a black notification.

I will do that print out for you. Bare with me.

I did manage to get the priority working using the following code but this doesn't output any icon:

.on("error", plugins.notify.onError({
        message: "<%= error.message %>",
        title: "Error Compiling",
        priority: 10,
        label: "Error"
    }))

Using just this from the gulp website code:

.on("error", notify.onError(function (error) {
    return "Message to the notifier: " + error.message;
  }));

Produces a normal black box and no icon.

Output from options

    { icon: <Buffer 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 02 02 00 0
0 02 02 08 06 00 00 00 bd 45 a5 cc 00 00 27 ab 49 44 41 54 78 da ed dd ed 6d 1b
bb b6 80 ...>,
      sound: 'Frog',
      title: 'Error running Gulp',
      message: 'Message to the notifier:     error sass/build.scss (Line 32: Invalid
     CSS after "    padding": expected ";", was ": 10px;")\r\nCompilation failed in
1 files.\r\n',
      open: '',
      subtitle: '' }

It looks like it should be showing an icon but doesn't.

I guess the error should have a default priority of 10 set on line 10 of report.js.

Not sure about the icon not working on an error as it's obviously being passed the option correctly.

This is using Snarl on Windows btw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants