Fixes #321.
This commit is contained in:
parent
015233a8b6
commit
4c99e3b6eb
2 changed files with 21 additions and 9 deletions
|
|
@ -309,8 +309,13 @@ proc buildFromDir(pkgInfo: PackageInfo, paths: seq[string], forRelease: bool) =
|
||||||
[pkgInfo.backend, releaseOpt, args, outputOpt,
|
[pkgInfo.backend, releaseOpt, args, outputOpt,
|
||||||
realDir / bin.changeFileExt("nim")])
|
realDir / bin.changeFileExt("nim")])
|
||||||
except NimbleError:
|
except NimbleError:
|
||||||
raise newException(BuildFailed, "Build failed for package: " &
|
let currentExc = (ref NimbleError)(getCurrentException())
|
||||||
pkgInfo.name)
|
let exc = newException(BuildFailed, "Build failed for package: " &
|
||||||
|
pkgInfo.name)
|
||||||
|
let (error, hint) = getOutputInfo(currentExc)
|
||||||
|
exc.msg.add("\nDetails:\n" & error)
|
||||||
|
exc.hint = hint
|
||||||
|
raise exc
|
||||||
|
|
||||||
proc saveNimbleMeta(pkgDestDir, url, vcsRevision: string,
|
proc saveNimbleMeta(pkgDestDir, url, vcsRevision: string,
|
||||||
filesInstalled, bins: HashSet[string]) =
|
filesInstalled, bins: HashSet[string]) =
|
||||||
|
|
@ -1072,13 +1077,8 @@ when isMainModule:
|
||||||
try:
|
try:
|
||||||
parseCmdLine().doAction()
|
parseCmdLine().doAction()
|
||||||
except NimbleError:
|
except NimbleError:
|
||||||
let err = (ref NimbleError)(getCurrentException())
|
let currentExc = (ref NimbleError)(getCurrentException())
|
||||||
error = err.msg
|
(error, hint) = getOutputInfo(currentExc)
|
||||||
when not defined(release):
|
|
||||||
let stackTrace = getStackTrace(getCurrentException())
|
|
||||||
error = stackTrace & "\n\n" & error
|
|
||||||
if not err.isNil:
|
|
||||||
hint = err.hint
|
|
||||||
except NimbleQuit:
|
except NimbleQuit:
|
||||||
nil
|
nil
|
||||||
finally:
|
finally:
|
||||||
|
|
|
||||||
|
|
@ -49,5 +49,17 @@ when not defined(nimscript):
|
||||||
exc.hint = hint
|
exc.hint = hint
|
||||||
raise exc
|
raise exc
|
||||||
|
|
||||||
|
proc getOutputInfo*(err: ref NimbleError): (string, string) =
|
||||||
|
var error = ""
|
||||||
|
var hint = ""
|
||||||
|
error = err.msg
|
||||||
|
when not defined(release):
|
||||||
|
let stackTrace = getStackTrace(err)
|
||||||
|
error = stackTrace & "\n\n" & error
|
||||||
|
if not err.isNil:
|
||||||
|
hint = err.hint
|
||||||
|
|
||||||
|
return (error, hint)
|
||||||
|
|
||||||
const
|
const
|
||||||
nimbleVersion* = "0.8.3"
|
nimbleVersion* = "0.8.3"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue