Show better error when standard library cannot be found.

This commit is contained in:
Dominik Picheta 2018-01-09 21:56:12 +00:00
commit 182893c529
2 changed files with 21 additions and 3 deletions

View file

@ -329,12 +329,14 @@ proc readPackageInfo(nf: NimbleFile, options: Options,
try:
readPackageInfoFromNims(nf, options, result)
result.isNimScript = true
except NimbleError:
except NimbleError as exc:
if exc.hint.len > 0:
raise
let msg = "Could not read package info file in " & nf & ";\n" &
" Reading as ini file failed with: \n" &
" " & iniError.msg & ".\n" &
" Evaluating as NimScript file failed with: \n" &
" " & getCurrentExceptionMsg() & "."
" " & exc.msg & "."
raise newException(NimbleError, msg)
# By default specialVersion is the same as version.