Skip to content

Commit 3245595

Browse files
Merge branch 'greyson-signal-feature/notadb-exception'
2 parents 1b75820 + 08e43d4 commit 3245595

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package net.zetetic.database.sqlcipher;
2+
3+
import android.database.sqlite.SQLiteException;
4+
5+
/**
6+
* An exception that is specific to the "SQLITE_NOTADB" error code.
7+
*
8+
* <a href="https://www.sqlite.org/rescode.html#notadb">SQLITE_NOTADB</a>
9+
*/
10+
class SQLiteNotADatabaseException extends SQLiteException {
11+
public SQLiteNotADatabaseException() {
12+
super();
13+
}
14+
15+
public SQLiteNotADatabaseException(String error) {
16+
super(error);
17+
}
18+
19+
public SQLiteNotADatabaseException(String error, Throwable cause) {
20+
super(error, cause);
21+
}
22+
}

sqlcipher/src/main/jni/sqlcipher/android_database_SQLiteCommon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void throw_sqlite3_exception(JNIEnv* env, int errcode,
7474
/* Upstream treats treat "unsupported file format" error as corruption (SQLiteDatabaseCorruptException).
7575
However, SQLITE_NOTADB can occur with mismatched keys, which is not a corruption case, so SQLCipher
7676
treats this as a general exception */
77-
exceptionClass = "android/database/sqlite/SQLiteException";
77+
exceptionClass = "net/zetetic/database/sqlcipher/SQLiteNotADatabaseException";
7878
break;
7979
case SQLITE_CONSTRAINT:
8080
exceptionClass = "android/database/sqlite/SQLiteConstraintException";

0 commit comments

Comments
 (0)