[7.x] i18n_extract function enhancement (#32210)

This commit is contained in:
Aleh Zasypkin 2019-02-28 18:33:57 +02:00 committed by GitHub
parent a8253de5b6
commit e35e1a1a5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View file

@ -47,7 +47,6 @@
"xpack.watcher": "x-pack/plugins/watcher"
},
"exclude": [
"src/core/public/fatal_errors/get_error_info.ts",
"src/legacy/ui/ui_render/bootstrap/app_bootstrap.js",
"src/legacy/ui/ui_render/ui_render_mixin.js",
"x-pack/plugins/infra/server/lib/domains/log_entries_domain/log_entries_domain.ts"

View file

@ -22,7 +22,7 @@ import { inspect } from 'util';
/**
* Produce a string version of an error,
*/
function formatMessage(error: any) {
function formatErrorMessage(error: any) {
if (typeof error === 'string') {
return error;
}
@ -70,7 +70,7 @@ function formatStack(err: Error) {
export function getErrorInfo(error: any, source?: string) {
const prefix = source ? source + ': ' : '';
return {
message: prefix + formatMessage(error),
message: prefix + formatErrorMessage(error),
stack: formatStack(error),
};
}