import Control.Exception (Exception)
import Control.Lens (Prism', (#))
import Control.Lens.TH (makePrisms)
-import Control.Monad.Error.Class (MonadError(..))
import Control.Monad.Except (ExceptT)
import Control.Monad.Reader (ReaderT)
+import Control.Monad.Error.Class (MonadError(..))
import Crypto.JOSE.Error as Jose
import Data.Aeson.Types
import Data.Typeable
joseError :: (MonadError e m, HasJoseError e) => Jose.Error -> m a
joseError = throwError . (_JoseError #)
+type HasJobEnv' env = HasJobEnv env JobLog JobLog
+
type EnvC env =
( HasConnectionPool env
, HasSettings env -- TODO rename HasDbSettings
)
type GargServerC env err m =
- ( CmdRandom env err m
+ ( CmdRandom env err m
, HasNodeStory env err m
- , EnvC env
- , ErrC err
- , ToJSON err
+ , EnvC env
+ , ErrC err
+ , ToJSON err
)
type GargServerT env err m api = GargServerC env err m => ServerT api m
)
-------------------------------------------------------------------
-
data GargError
= GargNodeError NodeError
| GargTreeError TreeError
instance HasJoseError GargError where
_JoseError = _GargJoseError
-
------------------------------------------------------------------------
-- | Utils
-- | Simulate logs