Skip to content

Commit

Permalink
fix(conan): Correct the error handling when listing remotes
Browse files Browse the repository at this point in the history
As `run` throws on error, the `isError` check never returned `true`.
Catch any error instead.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Nov 7, 2024
1 parent e13d2d6 commit 2e70da8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/package-managers/conan/src/main/kotlin/Conan.kt
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,9 @@ class Conan(
}

// List configured remotes in "remotes.txt" format.
val remoteList = run("remote", "list", "--raw")
if (remoteList.isError) {
val remoteList = runCatching {
run("remote", "list", "--raw")
}.getOrElse {
logger.warn { "Failed to list remotes." }
return
}
Expand Down

0 comments on commit 2e70da8

Please sign in to comment.