'refactor'

This commit is contained in:
Jon Schoning 2016-11-10 18:05:01 -06:00
parent c517fb896a
commit 7da76ed767
2 changed files with 7 additions and 8 deletions

View file

@ -50,7 +50,7 @@ import Control.Monad.IO.Class
import Control.Monad.Reader
import Control.Exception.Safe
import Control.Monad.Error.Class (throwError)
import Control.Monad.Error.Class
import Data.ByteString.Char8 (pack)
import Data.Monoid ((<>))
@ -138,14 +138,13 @@ runPinboardSingleRawBS
runPinboardSingleRawBS config req = do
res <- runPinboardSingleRaw config req
case checkStatusCodeResponse res of
Left e ->
runConfigLoggingT
config
(do logNST LevelError logSrc (toText e)
return (throwError e))
Right _ -> return (return (responseBody res))
Left e -> logErrorAndThrow e
Right _ -> (return.return) (responseBody res)
where
logSrc = "runPinboardSingleRawBS"
logErrorAndThrow e = runConfigLoggingT config $ do
logNST LevelError logSrc (toText e)
return (throwError e)
runPinboardSingleJson
:: (MonadErrorPinboard e, FromJSON a)

View file

@ -3,5 +3,5 @@ extra-package-dbs: []
packages:
- '.'
extra-deps: []
resolver: nightly-2016-10-29
resolver: nightly-2016-11-09