diff --git a/x-pack/plugins/upgrade_assistant/public/application/lib/api.ts b/x-pack/plugins/upgrade_assistant/public/application/lib/api.ts index c1a70263d77c599..a4a647385549a1d 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/lib/api.ts +++ b/x-pack/plugins/upgrade_assistant/public/application/lib/api.ts @@ -116,6 +116,7 @@ export class ApiService { body: { settings: JSON.stringify(settings), }, + errorInterceptors: this.errorInterceptors, }); return result; @@ -126,6 +127,7 @@ export class ApiService { path: `${API_BASE_PATH}/ml_snapshots`, method: 'post', body, + errorInterceptors: this.errorInterceptors, }); return result; @@ -135,6 +137,7 @@ export class ApiService { const result = await this.sendRequest({ path: `${API_BASE_PATH}/ml_snapshots/${jobId}/${snapshotId}`, method: 'delete', + errorInterceptors: this.errorInterceptors, }); return result; @@ -150,6 +153,17 @@ export class ApiService { return await this.sendRequest({ path: `${API_BASE_PATH}/ml_snapshots/${jobId}/${snapshotId}`, method: 'get', + errorInterceptors: this.errorInterceptors, + }); + } + + public useLoadMlUpgradeMode() { + return this.useRequest<{ + mlUpgradeModeEnabled: boolean; + }>({ + path: `${API_BASE_PATH}/ml_upgrade_mode`, + method: 'get', + errorInterceptors: this.errorInterceptors, }); } @@ -157,6 +171,7 @@ export class ApiService { return await this.sendRequest({ path: `${API_BASE_PATH}/reindex/${indexName}`, method: 'get', + errorInterceptors: this.errorInterceptors, }); } @@ -164,6 +179,7 @@ export class ApiService { return await this.sendRequest({ path: `${API_BASE_PATH}/reindex/${indexName}`, method: 'post', + errorInterceptors: this.errorInterceptors, }); } @@ -171,15 +187,7 @@ export class ApiService { return await this.sendRequest({ path: `${API_BASE_PATH}/reindex/${indexName}/cancel`, method: 'post', - }); - } - - public useLoadMlUpgradeMode() { - return this.useRequest<{ - mlUpgradeModeEnabled: boolean; - }>({ - path: `${API_BASE_PATH}/ml_upgrade_mode`, - method: 'get', + errorInterceptors: this.errorInterceptors, }); } } diff --git a/x-pack/plugins/upgrade_assistant/server/lib/es_version_precheck.ts b/x-pack/plugins/upgrade_assistant/server/lib/es_version_precheck.ts index fdb187290b1d58d..b79d33f84c14ba6 100644 --- a/x-pack/plugins/upgrade_assistant/server/lib/es_version_precheck.ts +++ b/x-pack/plugins/upgrade_assistant/server/lib/es_version_precheck.ts @@ -102,24 +102,24 @@ export const esVersionCheck = async ( }; export const versionCheckHandlerWrapper = - (handler: RequestHandler, isFailure) => + (handler: RequestHandler, /*isFailure*/) => async ( ctx: RequestHandlerContext, request: KibanaRequest, response: KibanaResponseFactory ) => { - if (isFailure) { - return response.customError({ - // 426 means "Upgrade Required" and is used when semver compatibility is not met. - statusCode: 426, - body: { - message: 'There are some nodes running a different version of Elasticsearch', - attributes: { - allNodesUpgraded: false, - }, - }, - }); - } + // if (isFailure) { + // return response.customError({ + // // 426 means "Upgrade Required" and is used when semver compatibility is not met. + // statusCode: 426, + // body: { + // message: 'There are some nodes running a different version of Elasticsearch', + // attributes: { + // allNodesUpgraded: false, + // }, + // }, + // }); + // } const errorResponse = await esVersionCheck(ctx, response); if (errorResponse) { return errorResponse; diff --git a/x-pack/plugins/upgrade_assistant/server/routes/app.ts b/x-pack/plugins/upgrade_assistant/server/routes/app.ts index 1a27435385bf9c3..682dc83410f81b2 100644 --- a/x-pack/plugins/upgrade_assistant/server/routes/app.ts +++ b/x-pack/plugins/upgrade_assistant/server/routes/app.ts @@ -74,8 +74,7 @@ export function registerAppRoutes({ } catch (error) { return handleEsError({ error, response }); } - }, - true + } ) ); }