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

Improve error handling #11

Open
hu0p opened this issue Jan 9, 2020 · 1 comment
Open

Improve error handling #11

hu0p opened this issue Jan 9, 2020 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@hu0p
Copy link

hu0p commented Jan 9, 2020

Hi Sindre! This is awesome, and I've wanted to do something like this for a long time. Thanks for all your hard work!

Something I noticed when trying out the Unsplash random puppy API example is that it seems to occasionally return dead URLs. When that happens, this error is thrown:

Screen Shot 2020-01-09 at 11 27 01 AM

This also happens if any server Plash is periodically hitting suddenly goes down or a URL to somewhere that is obviously down is entered in the config. I think the latter may have also just led to a crash for me.

Would it be possible to do an initial check to see if a server is up when it's entered in the config and in the event that it becomes unavailable notify the user of an error via the menu bar icon? Meanwhile, Plash could keep testing for valid responses in the background while maintaining the current valid image.

I'd love to help out with this, but I'm afraid I have very minimal knowledge of Swift. I write JS for a living. 😅

@sindresorhus sindresorhus added enhancement New feature or request help wanted Extra attention is needed labels Jan 11, 2020
sindresorhus added a commit that referenced this issue Jan 11, 2020
Don't show interactive error message when not in browsing mode. Instead, make the menu bar icon red and show the error in the menu bar icon tooltip and menu.

Part of #11
@sindresorhus
Copy link
Owner

sindresorhus commented Jan 11, 2020

I've implemented part of this in be2f382.

Don't show interactive error message when not in browsing mode. Instead, make the menu bar icon red and show the error in the menu bar icon tooltip and menu.

We still have to do:

Meanwhile, Plash could keep testing for valid responses in the background while maintaining the current valid image.

For this, we'll need to maintain two web view and only switch to the new web view on success. This is also needed for #9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants