Skip to content
This repository was archived by the owner on Oct 14, 2022. It is now read-only.

Commit a86f32d

Browse files
M66Bnpurushe
authored andcommitted
Add descriptive message to CursorWindow exceptions (requery#115)
1 parent 7bfb8ee commit a86f32d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sqlite-android/src/main/jni/sqlite/android_database_CursorWindow.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,15 @@ static struct {
3939
static jstring gEmptyString = NULL;
4040

4141
static void throwExceptionWithRowCol(JNIEnv* env, jint row, jint column) {
42-
jniThrowException(env, "java/lang/IllegalStateException", "Couldn't read row");
42+
char buf[64];
43+
snprintf(buf, sizeof(buf), "Couldn't read row %d column %d", row, column);
44+
jniThrowException(env, "java/lang/IllegalStateException", buf);
4345
}
4446

4547
static void throwUnknownTypeException(JNIEnv * env, jint type) {
46-
jniThrowException(env, "java/lang/IllegalStateException", "UNKNOWN type");
48+
char buf[32];
49+
snprintf(buf, sizeof(buf), "UNKNOWN type %d", type);
50+
jniThrowException(env, "java/lang/IllegalStateException", buf);
4751
}
4852

4953
static jlong nativeCreate(JNIEnv* env, jclass clazz, jstring nameObj, jint cursorWindowSize) {

0 commit comments

Comments
 (0)