Prevent crash when min. is higher than max. in expected range #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The project I used
geas
on reports, in its analysisand
geas_api.hrl
'scompat/2
will eventually calculate:MinGlob
as25.0
(because I'm usinglists:uniq/1
, for example)MaxGlob
as20.3
(because of the above)MaxGlob
is the lowest version among the highest calculated (as per the current code)This, in turn, means (using the default
geas
options),geas_semver:l2s/1
will throw because of a call tohd
ingeas_semver:seq2range/1
.This pr aims at preventing this by considering it is possible/valid to have such an output as the one first shown, though it shouldn't affect the application's behaviour by crashing.
At the same time we
throw(5)
, which results in===> The release window does not match the required SemVer version frame
which seems appropriate in this case (we also do a minor tweak on the error message).
Further considerations
Mind you the output for
T :
will not be followed by any text, but this might be undesirable. Lemme know and I can adapt the pr.