BigQuery/src/InsertResponse.php
public function failedRows()
    {
        $rows = [];

        if ($this->isSuccessful()) {
            return $rows;
        }

        foreach ($this->info['insertErrors'] as $error) {
            $rows[] = $error + [
                'rowData' => $this->rows[$error['index']]['json']
            ];
        }

        return $rows;
    }
public function failedRows()
    {
        $rows = [];

        if ($this->isSuccessful()) {
            return $rows;
        }

        foreach ($this->info['insertErrors'] as $error) {
            $rows[] = $error + [
                'rowData' => $this->rows[$error['index']]['json']
            ];
        }

        return $rows;
    }
public function failedRows ( ) { $ rows = [ ] ; if ( $ this -> isSuccessful ( ) ) { return $ rows ; } foreach ( $ this -> info [ 'insertErrors' ] as $ error ) { $ rows [ ] = $ error + [ 'rowData' => $ this -> rows [ $ error [ 'index' ] ] [ 'json' ] ] ; } return $ rows ; }
Returns the rows which failed to insert along with their associated
errors and index in the original data set.

Example:
```
$rows = $insertResponse->failedRows();

foreach ($rows as $row) {
print_r($row['rowData']) . PHP_EOL;

foreach ($row['errors'] as $error) {
echo $error['reason'] . ': ' . $error['message'] . PHP_EOL;
}
}
```

@see https://cloud.google.com/bigquery/docs/reference/v2/tabledata/insertAll#response
Tabledata insertAll API response documentation.

@return array
Returns the rows which failed to insert along with their associated errors and index in the original data set .