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

Commit 0e23f3c1 authored by Fyodor Kupolov's avatar Fyodor Kupolov Committed by android-build-merger
Browse files

Merge "List column names in the error message" into oc-mr1-dev am: 2729912a

am: 8fa408ca

Change-Id: I5af4bd6734f40941db433c98339a65a6283b3fc9
parents 60d85d10 8fa408ca
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.os.UserHandle;
import android.util.Log;

import java.lang.ref.WeakReference;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

@@ -330,7 +331,14 @@ public abstract class AbstractCursor implements CrossProcessCursor {
    public int getColumnIndexOrThrow(String columnName) {
        final int index = getColumnIndex(columnName);
        if (index < 0) {
            throw new IllegalArgumentException("column '" + columnName + "' does not exist");
            String availableColumns = "";
            try {
                availableColumns = Arrays.toString(getColumnNames());
            } catch (Exception e) {
                Log.d(TAG, "Cannot collect column names for debug purposes", e);
            }
            throw new IllegalArgumentException("column '" + columnName
                    + "' does not exist. Available columns: " + availableColumns);
        }
        return index;
    }