Skip to content

Commit b1a795e

Browse files
committed
Use IllegalArgumentException for PostgresIdAdapter
It's a better fit than IllegalStateException.
1 parent cecbe21 commit b1a795e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libpretixsync/src/main/java/eu/pretix/libpretixsync/sqldelight/PostgresIdAdapter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class PostgresIdAdapter : ColumnAdapter<Long, Int> {
1717

1818
override fun encode(value: Long): Int {
1919
if (value < Int.MIN_VALUE || value > Int.MAX_VALUE) {
20-
throw IllegalStateException("ID value exceeds integer range")
20+
throw IllegalArgumentException("ID value exceeds integer range")
2121
}
2222

2323
return value.toInt()

0 commit comments

Comments
 (0)