Skip to content

Commit 14fddc1

Browse files
committed
Fix throwing Error instead of Exception
Got JavaScript on the brain.
1 parent aef863a commit 14fddc1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/kotlin/com/coder/gateway/views/steps/CoderWizardStep.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ sealed class CoderWizardStep<T>(
6969
*/
7070
fun <A, Z> withoutNull(a: A?, block: (a: A) -> Z): Z {
7171
if (a == null) {
72-
throw Error("Unexpected null value")
72+
throw Exception("Unexpected null value")
7373
}
7474
return block(a)
7575
}
@@ -80,7 +80,7 @@ fun <A, Z> withoutNull(a: A?, block: (a: A) -> Z): Z {
8080
*/
8181
fun <A, B, Z> withoutNull(a: A?, b: B?, block: (a: A, b: B) -> Z): Z {
8282
if (a == null || b == null) {
83-
throw Error("Unexpected null value")
83+
throw Exception("Unexpected null value")
8484
}
8585
return block(a, b)
8686
}
@@ -91,7 +91,7 @@ fun <A, B, Z> withoutNull(a: A?, b: B?, block: (a: A, b: B) -> Z): Z {
9191
*/
9292
fun <A, B, C, D, Z> withoutNull(a: A?, b: B?, c: C?, d: D?, block: (a: A, b: B, c: C, d: D) -> Z): Z {
9393
if (a == null || b == null || c == null || d == null) {
94-
throw Error("Unexpected null value")
94+
throw Exception("Unexpected null value")
9595
}
9696
return block(a, b, c, d)
9797
}

src/main/kotlin/com/coder/gateway/views/steps/CoderWorkspacesStepView.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ class CoderWorkspacesStepView : CoderWizardStep<CoderWorkspacesStepSelection>(
595595
*/
596596
private fun triggerWorkspacePolling(fetchNow: Boolean) {
597597
if (poller != null && poller?.isCancelled != true) {
598-
throw Error("Poller was not canceled before starting a new one")
598+
throw Exception("Poller was not canceled before starting a new one")
599599
}
600600
poller = cs.launch {
601601
if (fetchNow) {

0 commit comments

Comments
 (0)