Skip to content

Commit 37473e5

Browse files
camdeardorffJohnSundell
authored andcommitted
catching and reporting errors encountered in 'publish run' (#17)
1 parent 6fb960a commit 37473e5

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Sources/PublishCLICore/WebsiteRunner.swift

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,15 @@ internal struct WebsiteRunner {
2525
""")
2626

2727
DispatchQueue.global().async {
28-
_ = try? shellOut(
29-
to: "python -m SimpleHTTPServer \(portNumber)",
30-
at: outputFolder.path
31-
)
28+
do {
29+
_ = try shellOut(
30+
to: "python -m SimpleHTTPServer \(portNumber)",
31+
at: outputFolder.path
32+
)
33+
} catch let error {
34+
let message = (error as? ShellOutError)?.message ?? error.localizedDescription
35+
print("Encountered error: \(message)")
36+
}
3237
}
3338

3439
_ = readLine()

0 commit comments

Comments
 (0)