Skip to content

Commit

Permalink
chore(pub): Improve the check for package info
Browse files Browse the repository at this point in the history
This should not be an `IOException`. Also quote the package name for
readability.

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Jan 24, 2025
1 parent 0868bb4 commit 955155a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/package-managers/pub/src/main/kotlin/Pub.kt
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ class Pub(
version = pkgInfoFromLockfile.version.orEmpty()
)

val packageInfo = packages[id] ?: throw IOException("Could not find package info for $packageName")
val packageInfo = requireNotNull(packages[id]) { "Could not find any info for package '$packageName'." }

try {
val dependencyPubspec = readPackageInfoFromCache(pkgInfoFromLockfile, workingDir)
Expand Down

0 comments on commit 955155a

Please sign in to comment.