Skip to content

Commit 9c640d2

Browse files
committed
Uses explicit error code when throwing if sqlite3_key or sqlite3_rekey fails
1 parent 55ed7af commit 9c640d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sqlcipher/src/main/jni/sqlcipher/android_database_SQLiteConnection.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ static jint nativeKey(JNIEnv* env, jclass clazz, jlong connectionPtr, jbyteArray
157157
}
158158
if (rc != SQLITE_OK) {
159159
ALOGE("sqlite3_key(%p) failed: %d", connection->db, rc);
160-
throw_sqlite3_exception(env, connection->db, "Could not key db.");
160+
throw_sqlite3_exception_errcode(env, rc, "Could not key db.");
161161
}
162162
return rc;
163163
}
@@ -178,7 +178,7 @@ static jint nativeKey(JNIEnv* env, jclass clazz, jlong connectionPtr, jbyteArray
178178
}
179179
if (rc != SQLITE_OK) {
180180
ALOGE("sqlite3_rekey(%p) failed: %d", connection->db, rc);
181-
throw_sqlite3_exception(env, connection->db, "Could not rekey db.");
181+
throw_sqlite3_exception_errcode(env, rc, "Could not rekey db.");
182182
}
183183
return rc;
184184
}

0 commit comments

Comments
 (0)