Skip to content

Commit ce14798

Browse files
author
Bojan
committed
Fix code debt.
1 parent aebaaf9 commit ce14798

File tree

12 files changed

+14
-14
lines changed

12 files changed

+14
-14
lines changed

dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/settings/interactors/RemoveIgnoredTableNameInteractor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ internal class RemoveIgnoredTableNameInteractor(
2222
entity.toBuilder().removeIgnoredTableNames(indexed.first).build()
2323
}
2424
}
25-
} ?: throw IllegalStateException("Ignored table name cannot be empty or blank.")
25+
} ?: error("Ignored table name cannot be empty or blank.")
2626
}
2727
}

dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/settings/interactors/SaveIgnoredTableNameInteractor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ internal class SaveIgnoredTableNameInteractor(
2121
)
2222
.build()
2323
}
24-
} ?: throw IllegalStateException("Ignored table name cannot be empty or blank.")
24+
} ?: error("Ignored table name cannot be empty or blank.")
2525
}
2626
}

dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/Delete.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ internal class Delete {
2222

2323
fun build(): String {
2424
if (!::table.isInitialized) {
25-
throw IllegalStateException("Failed to build - target table is undefined")
25+
error("Failed to build - target table is undefined")
2626
}
2727
return toString()
2828
}

dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/DropTrigger.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ internal class DropTrigger {
1414

1515
fun build(): String {
1616
if (!::trigger.isInitialized) {
17-
throw IllegalStateException("Failed to build - target view is undefined")
17+
error("Failed to build - target view is undefined")
1818
}
1919
return toString()
2020
}

dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/DropView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ internal class DropView {
1414

1515
fun build(): String {
1616
if (!::view.isInitialized) {
17-
throw IllegalStateException("Failed to build - target view is undefined")
17+
error("Failed to build - target view is undefined")
1818
}
1919
return toString()
2020
}

dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/Pragma.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internal class Pragma {
1919

2020
fun build(): String {
2121
if (!::pragmaName.isInitialized) {
22-
throw IllegalStateException("Failed to build - pragmaName is undefined")
22+
error("Failed to build - pragmaName is undefined")
2323
}
2424
return toString()
2525
}

dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/Select.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internal class Select {
1919

2020
fun columns(vararg columns: String) {
2121
if (this.columns.isNotEmpty()) {
22-
throw IllegalStateException("Detected an attempt to re-define columns to fetch.")
22+
error("Detected an attempt to re-define columns to fetch.")
2323
}
2424
this.columns.addAll(columns)
2525
}
@@ -39,7 +39,7 @@ internal class Select {
3939
throw IllegalArgumentException("At least one column should be defined")
4040
}
4141
if (this.orderByColumns.isNotEmpty()) {
42-
throw IllegalStateException("Detected an attempt to re-define ORDER BY columns.")
42+
error("Detected an attempt to re-define ORDER BY columns.")
4343
}
4444
this.orderByColumns = columns.toList().filterNotNull()
4545
}
@@ -50,7 +50,7 @@ internal class Select {
5050

5151
fun build(): String {
5252
if (!::table.isInitialized) {
53-
throw IllegalStateException("Failed to build - target table is undefined")
53+
error("Failed to build - target table is undefined")
5454
}
5555
return toString()
5656
}

dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/conditions/Eq.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ internal class Eq(
1414
}
1515

1616
override fun addCondition(condition: Condition) {
17-
throw IllegalStateException("Can't add a nested condition to 'eq'")
17+
error("Can't add a nested condition to 'eq'")
1818
}
1919

2020
override fun toString(): String =

dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/conditions/Like.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal class Like(
1616
}
1717

1818
override fun addCondition(condition: Condition): Unit =
19-
throw IllegalStateException("Can't add a nested condition to 'like'")
19+
error("Can't add a nested condition to 'like'")
2020

2121
override fun toString(): String =
2222
"$column LIKE \"%%$value%%\""

dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/delegates/LifecycleConnectionDelegate.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ internal class LifecycleConnectionDelegate(
3030
.currentState
3131
.isAtLeast(Lifecycle.State.INITIALIZED).not()
3232
) {
33-
throw IllegalStateException("Owner has not passed created yet.")
33+
error("Owner has not passed created yet.")
3434
}
3535

3636
val extras = when (thisRef) {

0 commit comments

Comments
 (0)