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

Silently succeeds if there is no Internet connection. #498

Closed
kindaro opened this issue Aug 12, 2018 · 2 comments
Closed

Silently succeeds if there is no Internet connection. #498

kindaro opened this issue Aug 12, 2018 · 2 comments
Labels

Comments

@kindaro
Copy link

kindaro commented Aug 12, 2018

I have a flaky Internet connection. I was trying to install some packages from AUR and I was surprised when Aura silently did nothing. It took me a few moments to discover that my Internet connection went down.

Try it yourself:

% aura -As aura-bin
aur/aura-bin 1.4.0-1 (161 | 0.14)
    A secure package manager for Arch Linux and the AUR written in Haskell - Prebuilt binary
% sudo netctl stop-all
% aura -As aura-bin
% echo $?
0

Expected:

Aura should write an error message and return non-zero.

Actual:

Aura silently succeeds.


I am using Aura built from current master branch, commit 07e15e3 to be exact.


P.S. Overall, this is a great package, I am very happy about it, and very grateful to developers and maintainers.

@fosskers
Copy link
Owner

fosskers commented Aug 13, 2018

Here's a function within the code that makes calls to the AUR API:

unwrap :: MonadIO m => Manager -> ClientM RPCResp -> m [AurInfo]
unwrap m r = liftIO . fmap (either (const []) _results) $ runClientM r (ClientEnv m url Nothing)

runClientM is probably catching some lower-level IO exception that's bubbling up from the failed internet connection, then returning it to us as an Either. Then the either (const []) is dumping that error in favour of just dumbly returning us an empty list. Hence the silent success.

@fosskers
Copy link
Owner

Done! You'll now see an error if Aura can't connect to the AUR.

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

No branches or pull requests

2 participants