Skip to content

Commit

Permalink
[file_upload] include caused_by field for import failures (elastic#10…
Browse files Browse the repository at this point in the history
…7907)

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
nreese and kibanamachine authored Aug 10, 2021
1 parent 1649661 commit 37a97b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x-pack/plugins/file_upload/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ export interface ImportResponse {
export interface ImportFailure {
item: number;
reason: string;
caused_by?: {
type: string;
reason: string;
};
doc: ImportDoc;
}

Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/file_upload/server/import_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export function importDataProvider({ asCurrentUser }: IScopedClusterClient) {
failures.push({
item: i,
reason: item.index.error.reason,
caused_by: item.index.error.caused_by,
doc: data[i],
});
}
Expand Down

0 comments on commit 37a97b4

Please sign in to comment.