Skip to content

Commit

Permalink
chore(spdx): Give more context in require checks
Browse files Browse the repository at this point in the history
Check the license ID first and also show the optional name to eventually
give a hint which license is affected. For the extracted text, also show
the (now non-blank) license ID.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Dec 7, 2023
1 parent f9d1124 commit b3c98bb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions utils/spdx/src/main/kotlin/model/SpdxExtractedLicenseInfo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ data class SpdxExtractedLicenseInfo(
val seeAlsos: List<String> = emptyList()
) {
init {
require(extractedText.isNotBlank()) { "The extracted text must not be blank." }

require(licenseId.isNotBlank()) { "The license ID must not be blank." }
require(licenseId.isNotBlank()) { "The license ID must not be blank (the optional name is '$name')." }
require(extractedText.isNotBlank()) { "The extracted text must not be blank (the license ID is '$licenseId')." }
}
}

0 comments on commit b3c98bb

Please sign in to comment.