Skip to content

Commit

Permalink
Add api error message to the toast
Browse files Browse the repository at this point in the history
  • Loading branch information
dasansol92 committed May 27, 2021
1 parent 39c8133 commit b0d77b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ export const FleetEventFiltersCard = memo<PackageCustomExtensionComponentProps>(
try {
const summary = await eventFiltersApi.getSummary();
setStats(summary);
} catch (err) {
} catch (error) {
toasts.addDanger(
i18n.translate(
'xpack.securitySolution.endpoint.fleetCustomExtension.eventFiltersSummaryError',
{
defaultMessage: 'There was an error trying to fetch event filters stats',
defaultMessage: 'There was an error trying to fetch event filters stats: "{error}"',
values: { error },
}
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ export const FleetTrustedAppsCard = memo<PackageCustomExtensionComponentProps>((
try {
const response = await trustedAppsApi.getTrustedAppsSummary();
setStats(response);
} catch (err) {
} catch (error) {
toasts.addDanger(
i18n.translate(
'xpack.securitySolution.endpoint.fleetCustomExtension.eventFiltersSummaryError',
{
defaultMessage: 'There was an error trying to fetch trusted apps stats',
defaultMessage: 'There was an error trying to fetch trusted apps stats: "{error}"',
values: { error },
}
)
);
Expand Down

0 comments on commit b0d77b2

Please sign in to comment.