alfy icon indicating copy to clipboard operation
alfy copied to clipboard

Alfy eats errors from Run Script action

Open ErikMinekus opened this issue 7 years ago • 4 comments

Issuehunt badges

Alfred's workflow debugger only shows output from stderr. These lines redirect all output from stderr to alfy.error(), which then uses console.log() to print it to stdout:

loudRejection(alfy.error);
process.on('uncaughtException', alfy.error);
hookStd.stderr(alfy.error);

This means that any errors that occur inside a Run Script action are never displayed in the workflow debugger.


IssueHunt Summary

Backers (Total: $20.00)

Submitted pull Requests


Become a backer now!

Or submit a pull request to get the deposits!

Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

ErikMinekus avatar Mar 30 '18 09:03 ErikMinekus

Yes, we show the error in the Alfy itself instead:

https://github.com/sindresorhus/alfy/blob/0dafe8f4f1b8e9b95b4d017a47dfe7d1553b0dbe/index.js#L70-L96

But you're right, we should also enable stderr to go through so it's also shown in the debugger.

sindresorhus avatar Mar 16 '19 09:03 sindresorhus

@issuehunt has funded $20.00 to this issue.


IssueHuntBot avatar Mar 21 '19 08:03 IssueHuntBot

I think we don't need hook-std here. Remove the hook-std and add console.error to alfy.error will fix this issue.

LitoMore avatar Sep 03 '19 10:09 LitoMore

If anyone wants to work on this, see the initial attempt and feedback in https://github.com/sindresorhus/alfy/pull/112.

sindresorhus avatar Mar 07 '21 08:03 sindresorhus