mirror of
https://github.com/digital-asset/daml.git
synced 2024-11-08 21:34:22 +03:00
Port file was not written to... where? (#11108)
* Port file was not written to... where? Adds the information on where the port file could not be written. From the current phrasing it appears the intention was to add the information but ultimately wasn't. changelog_begin changelog_end * Address https://github.com/digital-asset/daml/pull/11108#pullrequestreview-770115835
This commit is contained in:
parent
a8d703b996
commit
4860271a53
@ -19,6 +19,7 @@ import Control.Concurrent (threadDelay)
|
||||
import Control.Exception.Safe (IOException, catchJust, mask, onException)
|
||||
import Control.Monad
|
||||
import qualified Data.Text.IO as T
|
||||
import Data.Text (pack)
|
||||
import Safe (readMay)
|
||||
import System.Environment (getEnvironment)
|
||||
import System.Exit (exitFailure)
|
||||
@ -143,8 +144,8 @@ nullDevice
|
||||
| otherwise = "/dev/null"
|
||||
|
||||
readPortFile :: Int -> String -> IO Int
|
||||
readPortFile 0 _file = do
|
||||
T.hPutStrLn stderr "Port file was not written to in time."
|
||||
readPortFile 0 file = do
|
||||
T.hPutStrLn stderr ("Port file was not written to '" <> pack file <> "' in time.")
|
||||
exitFailure
|
||||
readPortFile n file = do
|
||||
fileContent <- catchJust (guard . shouldCatch) (readFile file) (const $ pure "")
|
||||
|
@ -8,14 +8,15 @@ import Control.Concurrent
|
||||
import Control.Exception
|
||||
import Control.Monad
|
||||
import qualified Data.Text.IO as T
|
||||
import Data.Text (pack)
|
||||
import Safe (readMay)
|
||||
import System.Exit
|
||||
import System.IO
|
||||
import System.IO.Error
|
||||
|
||||
readPortFile :: Int -> String -> IO Int
|
||||
readPortFile 0 _file = do
|
||||
T.hPutStrLn stderr "Port file was not written to in time."
|
||||
readPortFile 0 file = do
|
||||
T.hPutStrLn stderr ("Port file was not written to '" <> pack file <> "' in time.")
|
||||
exitFailure
|
||||
readPortFile n file = do
|
||||
fileContent <- catchJust (guard . shouldCatch) (readFile file) (const $ pure "")
|
||||
|
Loading…
Reference in New Issue
Block a user