Example usage for android.database.sqlite SQLiteDatabaseCorruptException getMessage

List of usage examples for android.database.sqlite SQLiteDatabaseCorruptException getMessage

Introduction

In this page you can find the example usage for android.database.sqlite SQLiteDatabaseCorruptException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:io.requery.android.database.sqlite.SQLiteQuery.java

/**
 * Reads rows into a buffer.//from  ww w  .jav a 2 s . com
 *
 * @param window The window to fill into
 * @param startPos The start position for filling the window.
 * @param requiredPos The position of a row that MUST be in the window.
 * If it won't fit, then the query should discard part of what it filled.
 * @param countAllRows True to count all rows that the query would
 * return regardless of whether they fit in the window.
 * @return Number of rows that were enumerated.  Might not be all rows
 * unless countAllRows is true.
 *
 * @throws SQLiteException if an error occurs.
 * @throws OperationCanceledException if the operation was canceled.
 */
int fillWindow(CursorWindow window, int startPos, int requiredPos, boolean countAllRows) {
    acquireReference();
    try {
        window.acquireReference();
        try {
            return getSession().executeForCursorWindow(getSql(), getBindArgs(), window, startPos, requiredPos,
                    countAllRows, getConnectionFlags(), mCancellationSignal);
        } catch (SQLiteDatabaseCorruptException ex) {
            onCorruption();
            throw ex;
        } catch (SQLiteException ex) {
            Log.e(TAG, "exception: " + ex.getMessage() + "; query: " + getSql());
            throw ex;
        } finally {
            window.releaseReference();
        }
    } finally {
        releaseReference();
    }
}