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

Unhandled promise rejection #53

Closed
holterdipolter opened this issue Apr 27, 2022 · 7 comments · Fixed by #54
Closed

Unhandled promise rejection #53

holterdipolter opened this issue Apr 27, 2022 · 7 comments · Fixed by #54

Comments

@holterdipolter
Copy link

holterdipolter commented Apr 27, 2022

Hi,
thank you for this very useful extension!

I have one little complain, which might be simple to solve: My systemd user log shows for each command executor executes the following message...

Unhandled promise rejection. To suppress this warning, add an error handler to your promise chain with .catch() or a try-catch block around your await expression. Stack trace of the failed promise:
    setOutput@/home/simon/.local/share/gnome-shell/extensions/executor@raujonas.github.io/extension.js:333:25
    callback@/home/simon/.local/share/gnome-shell/extensions/executor@raujonas.github.io/extension.js:323:14
    execCommand/</<@/home/simon/.local/share/gnome-shell/extensions/executor@raujonas.github.io/extension.js:272:26

Executor itself works quite well but as I fire off multiple commands every couple of minutes my systemd log is littered by this message.
Hence it would be very helpful if you could insert some kind of error handling in your code!

Thanks in advance!

Simon

@marqsbla
Copy link

marqsbla commented Jun 6, 2022

I have the same issue. Would be grateful for help

@BillyCroan
Copy link

Confirming presence of same bug on Fedora 36 x86_64, Gnome gnome-shell-42.2-1.fc36.x86_64. Plugin version 18, seen in /home/myusername/.local/share/gnome-shell/extensions/executor@raujonas.github.io/metadata.json.

I'll try and fix it locally and report back what I did if it works.

@raujonas
Copy link
Owner

raujonas commented Jun 7, 2022

Hey all and apologies for the late reply! Thanks very much for raising this issue.

To me it seems like I missed handling an empty settings array in the setOutput function, I think I only used it with some additional settings in the past months (maybe time to add some tests 😏), so that likely broke when I implemented that feature.

My system log is now clean again with continuously executing commands every few seconds. It would be great if someone could confirm that these changes help on your machines, then I'd package a new version as soon as possible.

@holterdipolter
Copy link
Author

Can confirm, log is clean again! Thank you so much for your effort!! So nice to clearly see all other errors again ☺️.

@marqsbla
Copy link

marqsbla commented Jun 8, 2022

works for me. thanks

@BillyCroan
Copy link

BillyCroan commented Jun 9, 2022

I tried reinstalling plugin this morning and still got the error. Then tried installing via git clone and make-release.bash. same error.

then disabled, and downloaded the raw file https://raw.githubusercontent.com/raujonas/executor/21ad5d93813ba4efaed3cc022dd4e6e0af199d1d/extension.js and copied if over the original extension.js and re-enabled with gnome-shell-extension-tool -e executor@raujonas.github.io but still got the error. I'm a little confused, perhaps the old rev is being cached somewhere?

Nevermind. I had to git clone it, overwrite extention.js with the new raw version, then make-release, then alt-f2, r, then gnome-shell-extension-tool -e executor@raujonas.github.io

Now Executor is executing, and my /var/log/messages is much happier
Thank you Jonas!!!!! your extension is awesome, and makes my day a lot nicer!

@raujonas
Copy link
Owner

raujonas commented Jun 9, 2022

@BillyCroan I just uploaded the new version to the store, so you should receive the automatic update soon. Remember to switch back to the version from the store if you want to get the automatic updates after new versions are approved.

If you want to test changes from GitHub earlier locally, then you have multiple options. The make-release.bash is only a helper for me and makes the packaging of the extension consistent, it does not replace the running code locally. You would have to extract this zip to the extension folder and restart your shell.

What I'm currently doing is the following:

  • Clone the repo to whereever you want to
  • Create a symlink to the expected folder of the extension:
    ln -s /path/to/cloned/repo/executor/ /home/your-user/.local/share/gnome-shell/extensions/executor@raujonas.github.io
  • Restart gnome shell

Then you can easily remove the symlink and install it from the store again and switch back later to the repo again without having to delete any code.

I'm pleased that you like the extension, thanks for the feedback!

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

Successfully merging a pull request may close this issue.

4 participants