You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and the most important one - Nimble relies on the fact that after catching the exception the variable initialized in the "try" block still contains useful info (for validation), as shown in packageparser.nim, or for shorter example:
typePackageInfo*=object
myPath*: string## The path of this .nimble fileprocreadPackageInfo(): PackageInfo=result=PackageInfo(mypath: "testlol")
ifresult.mypath =="testlol":
raisenewException(ValueError, "testlol")
echoresult.mypath
procgetPkgInfoFromFile*(): PackageInfo=## Reads the specified .nimble file and returns its data as a PackageInfo## object. Any validation errors are handled and echoed as warnings.try:
result=readPackageInfo()
exceptValueError:
echo"error"echo"getPkgInfoFromFile:"echoresult.mypath
procgetPkgInfo*(): PackageInfo=returngetPkgInfoFromFile()
procdownloadPkg*() =let pkginfo =getPkgInfo()
echo pkginfo.mypath
downloadPkg()
I think this can be considered as relying on undefined behaviour, so this probably should be changed (store PackageInfo as the field in ValidationError ?)
The text was updated successfully, but these errors were encountered:
Just to store the info:
nimble.nim:416
- need to add nosinks likedownload.nim:113
- need to do the sameand the most important one - Nimble relies on the fact that after catching the exception the variable initialized in the "try" block still contains useful info (for validation), as shown in
packageparser.nim
, or for shorter example:I think this can be considered as relying on undefined behaviour, so this probably should be changed (store PackageInfo as the field in ValidationError ?)
The text was updated successfully, but these errors were encountered: