summaryrefslogtreecommitdiff
path: root/Utility/Quvi.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-08-22 21:09:04 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-08-22 21:12:41 -0400
commite28cea448c550e741926cfca5a12db1dc07b5a04 (patch)
tree5d499af8650281d1353ad2631557c132f5d03a3f /Utility/Quvi.hs
parent79f3e3e2dc8ed98040ae7467e85ddc637beb72de (diff)
better error message
Diffstat (limited to 'Utility/Quvi.hs')
-rw-r--r--Utility/Quvi.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Utility/Quvi.hs b/Utility/Quvi.hs
index 55a247cf3..5df1a4da7 100644
--- a/Utility/Quvi.hs
+++ b/Utility/Quvi.hs
@@ -41,9 +41,12 @@ type Query a = [CommandParam] -> URLString -> IO a
{- Throws an error when quvi is not installed. -}
forceQuery :: Query (Maybe Page)
-forceQuery ps url = flip catchNonAsync (const notinstalled) (query' ps url)
+forceQuery ps url = query' ps url `catchNonAsync` onerr
where
- notinstalled = error "quvi failed, or is not installed"
+ onerr _ = ifM (inPath "quvi")
+ ( error "quvi failed"
+ , error "quvi is not installed"
+ )
{- Returns Nothing if the page is not a video page, or quvi is not
- installed. -}