Skip to content

Commit

Permalink
add i18n to error
Browse files Browse the repository at this point in the history
  • Loading branch information
gmmorris committed Mar 17, 2020
1 parent ff17bb4 commit 7e569d6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion x-pack/plugins/alerting/server/routes/lib/error_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { i18n } from '@kbn/i18n';
import {
RequestHandler,
KibanaRequest,
Expand All @@ -25,7 +26,11 @@ export function handleDisabledApiKeysError<P, Q, B>(
} catch (e) {
if (isApiKeyDisabledError(e)) {
return response.badRequest({
body: new Error('Alerting relies upon API keys which appear to be are disabled'),
body: new Error(
i18n.translate('xpack.alerting.api.error.disabledApiKeys', {
defaultMessage: 'Alerting relies upon API keys which appear to be are disabled',
})
),
});
}
throw e;
Expand Down

0 comments on commit 7e569d6

Please sign in to comment.