Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4389023 authored by Vasu Nori's avatar Vasu Nori
Browse files

if db close() fails due to un-closed sql statements, print useful msg

The current error message says "close failed due to unfinalised statements".
This CL fixes that message by incorporating one of the un-closed sql statements
should help developers debug the problem.

Change-Id: I2a24c6ba876caa008507b236052c5f03e8cbb27e
parent b37f8a8a
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -1140,8 +1140,9 @@ public class SQLiteDatabase extends SQLiteClosable {
                }
            } else {
                // the statement is not yet closed. most probably programming error in the app.
                Log.w(TAG, "dbclose failed due to un-close()d SQL statements: " + msg);
                throw e;
                throw new SQLiteUnfinalizedObjectsException(
                        "close() on database: " + getPath() +
                        " failed due to un-close()d SQL statements: " + msg);
            }
        }
    }