Merge branch 'errormsg'
This commit is contained in:
commit
a933a8c2d5
|
@ -39,9 +39,10 @@ template `//`(url, fragment: string): string =
|
||||||
url & "/" & fragment
|
url & "/" & fragment
|
||||||
|
|
||||||
proc downloadFile(url: string): Future[string] {.async.} =
|
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:
|
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
|
return fileContents
|
||||||
|
|
||||||
proc updateTestnetMetadata(conf: BeaconNodeConf): Future[NetworkMetadata] {.async.} =
|
proc updateTestnetMetadata(conf: BeaconNodeConf): Future[NetworkMetadata] {.async.} =
|
||||||
|
|
Loading…
Reference in New Issue