Merge branch 'errormsg'

This commit is contained in:
Ștefan Talpalaru 2019-04-01 22:20:09 +02:00
commit a933a8c2d5
No known key found for this signature in database
GPG Key ID: CBF7934204F1B6F9
1 changed files with 3 additions and 2 deletions

View File

@ -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.} =