Closed HarrisonGrodin closed 4 years ago
Hrm. I'm trying to remember what we intended here. It's been a long time. I feel like this wasn't quite intended to be an error, so if you think it's recoverable in this way, I'd be happy to review a PR, but I'm low confidence on everything here because of lack of recall.
Given a project with an incomplete semantic version as a tag (say,
v0.1
), runningsmackage refresh
produces the following error message (twice):As far as I can tell, this is caused by a combination of
src/get-git.sml
andsrc/semver.sml
. Insrc/get-git.sml
, anyFail
exception is propagated asFail "I/O error trying to access temporary file"
: https://github.com/standardml/smackage/blob/eb383f0da0dcbed6c613ba9e569226a67460c120/src/get-git.sml#L32-L45Inconveniently,
fromString
raisesFail
given an incomplete semantic version: https://github.com/standardml/smackage/blob/eb383f0da0dcbed6c613ba9e569226a67460c120/src/semver.sml#L120-L124Thus, rather than
being mentioned, the misleading warning is produced.
It seems like this could be fixed by declaring a local exception to
raise
andhandle
rather than usingFail
. If this sounds reasonable, I'd be more than happy to put together a PR!