mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
17 lines
426 B
Haskell
17 lines
426 B
Haskell
module Handler.Util where
|
|
|
|
import Startlude
|
|
|
|
import Data.IORef
|
|
import Yesod.Core
|
|
|
|
import Foundation
|
|
import Lib.Error
|
|
|
|
disableEndpointOnFailedUpdate :: Handler a -> Handler a
|
|
disableEndpointOnFailedUpdate m = handleS9ErrT $ do
|
|
updateFailed <- getsYesod appIsUpdateFailed >>= liftIO . readIORef
|
|
case updateFailed of
|
|
Just e -> throwE e
|
|
Nothing -> lift m
|