Telegram-Android/TMessagesProj/jni/sqlite.c

12 lines
362 B
C
Raw Normal View History

2014-03-27 15:25:53 +01:00
#include "sqlite/sqlite3.h"
#include "sqlite.h"
2013-10-25 17:19:00 +02:00
void throw_sqlite3_exception(JNIEnv *env, sqlite3 *handle, int errcode) {
if (SQLITE_OK == errcode) {
errcode = sqlite3_errcode(handle);
}
const char *errmsg = sqlite3_errmsg(handle);
jclass exClass = (*env)->FindClass(env, "org/telegram/SQLite/SQLiteException");
(*env)->ThrowNew(env, exClass, errmsg);
}