From f6eb6af310945744a763147a4eeb5b64964afb54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Mon, 1 Apr 2019 20:41:35 +0200 Subject: [PATCH] downloadFile(): print command in the error message so people can figure out that they don't have "curl" installed --- beacon_chain/beacon_node.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/beacon_chain/beacon_node.nim b/beacon_chain/beacon_node.nim index 6a17b4fde..7778178c6 100644 --- a/beacon_chain/beacon_node.nim +++ b/beacon_chain/beacon_node.nim @@ -39,9 +39,10 @@ template `//`(url, fragment: string): string = url & "/" & fragment proc downloadFile(url: string): Future[string] {.async.} = - let (fileContents, errorCode) = execCmdEx("curl --fail " & url, options = {poUsePath}) + let cmd = "curl --fail " & url + let (fileContents, errorCode) = execCmdEx(cmd, options = {poUsePath}) if errorCode != 0: - raise newException(IOError, "Failed to download URL: " & url & "\n" & fileContents) + raise newException(IOError, "Failed external command: '" & cmd & "', exit code: " & $errorCode & ", output: '" & fileContents & "'") return fileContents proc updateTestnetMetadata(conf: BeaconNodeConf): Future[NetworkMetadata] {.async.} =