fix build with old http-client

This commit is contained in:
Joey Hess 2017-09-13 15:35:42 -04:00
parent bf48ba4ef7
commit 01068d8280
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -367,8 +367,16 @@ matchStatusCodeException want e@(StatusCodeException s _ _)
matchStatusCodeException _ _ = Nothing
#endif
#if MIN_VERSION_http_client(0,5,0)
matchHttpExceptionContent :: (HttpExceptionContent -> Bool) -> HttpException -> Maybe HttpException
matchHttpExceptionContent want e@(HttpExceptionRequest _ hec)
| want hec = Just e
| otherwise = Nothing
matchHttpExceptionContent _ _ = Nothing
#else
matchHttpExceptionContent :: (HttpException -> Bool) -> HttpException -> Maybe HttpException
matchHttpExceptionContent want e
| want e = Just e
| otherwise = Nothing
matchHttpExceptionContent _ _ = Nothing
#endif