Open SamuraiAku opened 1 year ago
Similarly for SpdxTimeV2, it unintentionally throws an exception when the time string is malformed
julia> SpdxTimeV2("2022-05-15T15:05:02P")
WARNING: SPDX creation date may not match the specification
ERROR: ArgumentError: Unable to parse string "2022-05-15T15:05:02P" using format dateformat"yyyy-mm-ddTHH:MM:SSZ". Unable to parse date time. Expected directive DatePart(Z) at char 20
Stacktrace:
Instead of just firing off a println(). But what is the right way to handle this situation?
SpdxPackageExternalReferenceV2 returns nothing when there is an error in the input string. That would cause a failure when building SpdxPackage because you can't put nothing
in a Vector{SpdxPackageExternalReferenceV2}
When a license string has something other that WITH for the middle word, we get the following
This should be an error or perhaps return
nothing
or return a NOASSERTION license expression. Not sure, have to think about that some more.On a related note, SpdxSimpleLicenseExpressionV2 does error out if presented with an empty license string is presented. Is that perhaps too harsh? Should it return
nothing
instead or NOASSERTION?Returning
nothing
would have to be coordinated with PkgToSoftwareBOM.jl to make sure that nothing there gets broken.