Skip to content

Commit

Permalink
chore: Don't log error if we can resolve stable PC
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Mar 22, 2024
1 parent 6ef8385 commit f640f06
Showing 1 changed file with 10 additions and 5 deletions.
Expand Up @@ -83,6 +83,12 @@ object MtagsResolver {
private val states =
new ConcurrentHashMap[String, State]()

def hasStablePresentationCompiler(scalaVersion: String) =
SemVer.isCompatibleVersion(
firstScala3PCVersion,
scalaVersion,
)

def isSupportedInOlderVersion(version: String): Boolean =
removedScalaVersions.contains(version)

Expand Down Expand Up @@ -153,7 +159,8 @@ object MtagsResolver {
s"Resolved latest nightly mtags version: $scalaVersion"
}
scribe.debug(msg)
case _: State.Failure =>
case _: State.Failure
if !hasStablePresentationCompiler(scalaVersion) =>
val errorMsg = resolveType match {
case ResolveType.Regular =>
s"Failed to resolve mtags for $scalaVersion"
Expand All @@ -163,6 +170,7 @@ object MtagsResolver {
s"Failed to resolve latest nightly mtags version: $scalaVersion"
}
scribe.info(errorMsg)
case _ =>
}
state
}
Expand Down Expand Up @@ -208,10 +216,7 @@ object MtagsResolver {
// Fallback to Stable PC version
case _: State.Failure
if resolveType != ResolveType.StablePC &&
SemVer.isCompatibleVersion(
firstScala3PCVersion,
scalaVersion,
) =>
hasStablePresentationCompiler(scalaVersion) =>
resolve(
scalaVersion,
None,
Expand Down

0 comments on commit f640f06

Please sign in to comment.