Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Avoid empty error messages #6

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function psc(opts) {
gutil.log('Stderr from \'' + gutil.colors.cyan('psc') + '\'\n' + gutil.colors.magenta(stderr));
});
cmd.on('close', function(code){
if (!!code) that.emit('error', new gutil.PluginError(PLUGIN, buffer.toString()));
if (!!code) that.emit('error', new gutil.PluginError(PLUGIN, "psc has failed"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth doing these as buffer.toString() || "psc has failed"? Or is the buffer always empty in this case?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@garyb I agree. I think we want to keep the buffer's value in these cases. Maybe we should go with your suggestion. Does this work for you @pelotom?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my experience it is always empty, but I'm certainly not opposed to showing it if there's ever something there.

else {
that.push(new gutil.File({
path: output,
Expand Down Expand Up @@ -136,7 +136,7 @@ function docgen(opts) {
gutil.log('Stderr from \'' + gutil.colors.cyan('docgen') + '\'\n' + gutil.colors.magenta(stderr));
});
cmd.on('close', function(code){
if (!!code) that.emit('error', new gutil.PluginError(PLUGIN, buffer.toString()));
if (!!code) that.emit('error', new gutil.PluginError(PLUGIN, "docgen failed"));
else {
that.push(new gutil.File({
path: '.',
Expand Down