Skip to content

Commit b5f3393

Browse files
committed
RI-5979 code format
1 parent c19e044 commit b5f3393

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

redisinsight/api/src/modules/rdi/client/api.rdi.client.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ describe('ApiRdiClient', () => {
327327

328328
describe('pollActionStatus', () => {
329329
const responseData = 'some data';
330-
const error = new Error('Test error');
331330
const actionId = 'test-action-id';
332331

333332
it('should return response data on success', async () => {

redisinsight/api/src/modules/rdi/client/api.rdi.client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
import {
2121
RdiPipelineDeployFailedException,
2222
RdiPipelineInternalServerErrorException,
23+
parseErrorMessage,
2324
wrapRdiPipelineError,
2425
} from 'src/modules/rdi/exceptions';
2526
import {
@@ -160,7 +161,7 @@ export class ApiRdiClient extends RdiClient {
160161
data: plainToClass(RdiStatisticsData, convertKeysToCamelCase(data)),
161162
};
162163
} catch (e) {
163-
const message: string = e.response?.data?.detail || e.message || '';
164+
const message: string = parseErrorMessage(e);
164165
return { status: RdiStatisticsStatus.Fail, error: message };
165166
}
166167
}

redisinsight/api/src/modules/rdi/exceptions/rdi-pipiline.error.handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
} from 'src/modules/rdi/exceptions';
77
import { RdiPipelineForbiddenException } from './rdi-pipeline.forbidden.exception';
88

9-
const parseErrorMessage = (error: AxiosError<any>): string => {
9+
export const parseErrorMessage = (error: AxiosError<any>): string => {
1010
const detail = error.response?.data?.detail;
1111
if (!detail) return error.message;
1212

0 commit comments

Comments
 (0)