File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -75,20 +75,27 @@ runLogT component logger maxLogLevel m = runReaderT (unLogT m) LoggerEnv {
7575-- doesn't guarantee that all messages are actually written to the log
7676-- once it finishes. Use 'withPGLogger' or 'withElasticSearchLogger'
7777-- for that.
78- runLogTAttentionOnFailure :: (MonadCatch m , MonadBase IO m )
78+ runLogTAttentionOnFailure :: (MonadBase IO m , MonadMask m )
7979 => Text -- ^ Application component name to use.
8080 -> Logger -- ^ The logging back-end to use.
8181 -> LogLevel -- ^ The maximum log level allowed to be logged.
8282 -- Only messages less or equal than this level with be logged.
8383 -> LogT m a -- ^ The 'LogT' computation to run.
8484 -> m a
8585runLogTAttentionOnFailure component logger maxLogLevel m =
86- runReaderT
87- (unLogT $ do
88- m `catch`
89- (\ (SomeException e) -> do
86+ fst <$> runReaderT
87+ (unLogT $
88+ generalBracket
89+ (pure () )
90+ (\ _ -> \ case
91+ ExitCaseSuccess _ -> pure ()
92+ ExitCaseException (SomeException e) -> do
9093 logAttention " Uncaught exception raised" $ object [" error" .= show e]
91- error " In a catch" ))
94+ error " In a catch"
95+ ExitCaseAbort ->
96+ logAttention_ " Process was aborted"
97+ )
98+ (const m))
9299 LoggerEnv
93100 { leLogger = logger
94101 , leComponent = component
You can’t perform that action at this time.
0 commit comments