File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
src/main/kotlin/com/coder/toolbox/cli Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package com.coder.toolbox.cli
33import com.coder.toolbox.CoderToolboxContext
44import com.coder.toolbox.cli.downloader.CoderDownloadApi
55import com.coder.toolbox.cli.downloader.CoderDownloadService
6+ import com.coder.toolbox.cli.downloader.DownloadResult
67import com.coder.toolbox.cli.downloader.DownloadResult.Downloaded
78import com.coder.toolbox.cli.ex.MissingVersionException
89import com.coder.toolbox.cli.ex.SSHConfigFormatException
@@ -168,7 +169,8 @@ class CoderCLIManager(
168169 }.let { result ->
169170 when {
170171 result.isSkipped() -> return false
171- result.isNotFoundOrFailed() -> throw IllegalStateException (" Could not find or download Coder CLI" )
172+ result.isNotFound() -> throw IllegalStateException (" Could not find Coder CLI" )
173+ result.isFailed() -> throw (result as DownloadResult .Failed ).error
172174 else -> result as Downloaded
173175 }
174176 }
Original file line number Diff line number Diff line change @@ -15,7 +15,9 @@ sealed class DownloadResult {
1515
1616 fun isSkipped (): Boolean = this is Skipped
1717
18- fun isNotFoundOrFailed (): Boolean = this is NotFound || this is Failed
18+ fun isNotFound (): Boolean = this is NotFound
19+
20+ fun isFailed (): Boolean = this is Failed
1921
2022 fun isDownloaded (): Boolean = this is Downloaded
2123
You can’t perform that action at this time.
0 commit comments