Route Flags load warnings to stderr
This commit is contained in:
@@ -24,6 +24,7 @@ import Data.Set (Set)
|
||||
import qualified Data.Set as S
|
||||
import Data.Text (Text)
|
||||
import System.FilePath ((</>))
|
||||
import System.IO (hPutStrLn, stderr)
|
||||
import System.IO.Error (isDoesNotExistError)
|
||||
|
||||
type Name = Text
|
||||
@@ -56,7 +57,7 @@ readFlagsFile path =
|
||||
decoded <- decodeFileStrict' path
|
||||
case decoded of
|
||||
Nothing -> do
|
||||
putStrLn ("handlers.json is unparseable; treating all handlers as enabled: " <> path)
|
||||
hPutStrLn stderr ("handlers.json is unparseable; treating all handlers as enabled: " <> path)
|
||||
pure mempty
|
||||
Just m -> pure (maybe mempty id m)
|
||||
where
|
||||
@@ -64,7 +65,7 @@ readFlagsFile path =
|
||||
onMissingOrUnreadable e
|
||||
| isDoesNotExistError e = pure mempty
|
||||
| otherwise = do
|
||||
putStrLn ("could not read handlers.json (" <> show e <> "); treating all handlers as enabled")
|
||||
hPutStrLn stderr ("could not read handlers.json (" <> show e <> "); treating all handlers as enabled")
|
||||
pure mempty
|
||||
|
||||
isEnabled :: MonadIO m => Flags -> Name -> m Bool
|
||||
|
||||
Reference in New Issue
Block a user