Improve error message
This commit is contained in:
parent
5400bf32c5
commit
74b2052739
|
@ -11,13 +11,14 @@ let
|
||||||
main = do
|
main = do
|
||||||
(configDir:hostname:args) <- getArgs
|
(configDir:hostname:args) <- getArgs
|
||||||
paths <- myNixPath $ toText configDir
|
paths <- myNixPath $ toText configDir
|
||||||
let command = ${commandline}
|
logFile <- mktemp |> captureTrim
|
||||||
bracket
|
\logFile -> do
|
||||||
(mktemp |> captureTrim)
|
let command = (${commandline}) &!> StdOut &> Append logFile
|
||||||
rm
|
failHandler = do
|
||||||
(\logFile -> do
|
say [i|### Build failure for ${name} config for #{hostname} ###|]
|
||||||
say [i|Trying to build ${name} config for #{hostname}. Logging to #{logFile}.|]
|
cat logFile
|
||||||
onException (command &!> StdOut &> Append logFile) (say [i|### Build failure for ${name} config for #{hostname} ###|] >> cat logFile))
|
say [i|Trying to build ${name} config for #{hostname}. Logging to #{logFile}.|]
|
||||||
|
onException command
|
||||||
say [i|Build of ${name} config for #{hostname} was successful.|]
|
say [i|Build of ${name} config for #{hostname} was successful.|]
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
|
|
Loading…
Reference in a new issue