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 <[email protected]>
  • Loading branch information
sschuberth committed Dec 9, 2024
1 parent a9746bf commit 5ec06b3
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 5ec06b3

Please sign in to comment.