Skip to content

Commit

Permalink
chore(conan): Move a potentially throwing call into runCatching
Browse files Browse the repository at this point in the history
Catch any exception from both `run()` calls.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Dec 9, 2024
1 parent b306a87 commit 431c75a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugins/package-managers/conan/src/main/kotlin/Conan.kt
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,13 @@ class Conan(
}

private fun configureRemoteAuthentication(conanConfig: File?) {
// Install configuration from a local directory if available.
conanConfig?.let {
run("config", "install", it.absolutePath).requireSuccess()
}

// List configured remotes in "remotes.txt" format.
val remoteList = runCatching {
// Install configuration from a local directory if available.
conanConfig?.let {
run("config", "install", it.absolutePath).requireSuccess()
}

// List configured remotes in "remotes.txt" format.
run("remote", "list", "--raw").requireSuccess()
}.getOrElse {
logger.warn { "Failed to list remotes." }
Expand Down

0 comments on commit 431c75a

Please sign in to comment.