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
3
3
import com.coder.toolbox.CoderToolboxContext
4
4
import com.coder.toolbox.cli.downloader.CoderDownloadApi
5
5
import com.coder.toolbox.cli.downloader.CoderDownloadService
6
+ import com.coder.toolbox.cli.downloader.DownloadResult
6
7
import com.coder.toolbox.cli.downloader.DownloadResult.Downloaded
7
8
import com.coder.toolbox.cli.ex.MissingVersionException
8
9
import com.coder.toolbox.cli.ex.SSHConfigFormatException
@@ -168,7 +169,8 @@ class CoderCLIManager(
168
169
}.let { result ->
169
170
when {
170
171
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
172
174
else -> result as Downloaded
173
175
}
174
176
}
Original file line number Diff line number Diff line change @@ -15,7 +15,9 @@ sealed class DownloadResult {
15
15
16
16
fun isSkipped (): Boolean = this is Skipped
17
17
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
19
21
20
22
fun isDownloaded (): Boolean = this is Downloaded
21
23
You can’t perform that action at this time.
0 commit comments