Skip to content

Commit

Permalink
adding text for unknown errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jgowdyelastic committed Jul 20, 2020
1 parent 9747e9d commit 323e1bf
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -629,11 +629,13 @@ export class DataRecognizer {
kibanaSaveResults: DataRecognizerConfigResponse['kibana'],
error: any
) {
const errorObj =
error === undefined ? { message: 'Unknown error when creating saved object' } : error;
(Object.keys(kibanaSaveResults) as Array<keyof DataRecognizerConfigResponse['kibana']>).forEach(
(type) => {
kibanaSaveResults[type].forEach((resultItem) => {
if (resultItem.exists === false) {
resultItem.error = error;
resultItem.error = errorObj;
}
});
}
Expand Down

0 comments on commit 323e1bf

Please sign in to comment.