Skip to content

Commit 7a4406b

Browse files
committed
chore: sonar fixes throw new Error Refs: KEH-277
1 parent 9e00dcd commit 7a4406b

10 files changed

Lines changed: 18 additions & 18 deletions

File tree

src/domain/event/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export const fetchEvent = async (
192192
});
193193
return data;
194194
} catch (error) {
195-
throw Error(JSON.stringify((error as AxiosError).response?.data), {
195+
throw new Error(JSON.stringify((error as AxiosError).response?.data), {
196196
cause: error,
197197
});
198198
}

src/domain/language/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const fetchLanguages = async (
2525
return data;
2626
} catch (error) {
2727
/* istanbul ignore next */
28-
throw Error(JSON.stringify((error as AxiosError).response?.data), {
28+
throw new Error(JSON.stringify((error as AxiosError).response?.data), {
2929
cause: error,
3030
});
3131
}

src/domain/order/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const fetchWebStoreOrder = async (
2121
});
2222
return data;
2323
} catch (error) {
24-
throw Error(JSON.stringify((error as AxiosError).response?.data), {
24+
throw new Error(JSON.stringify((error as AxiosError).response?.data), {
2525
cause: error,
2626
});
2727
}

src/domain/payment/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const fetchWebStorePayment = async (
2121
});
2222
return data;
2323
} catch (error) {
24-
throw Error(JSON.stringify((error as AxiosError).response?.data), {
24+
throw new Error(JSON.stringify((error as AxiosError).response?.data), {
2525
cause: error,
2626
});
2727
}

src/domain/registration/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const fetchRegistration = async (
4141
});
4242
return data;
4343
} catch (error) {
44-
throw Error(JSON.stringify((error as AxiosError).response?.data), {
44+
throw new Error(JSON.stringify((error as AxiosError).response?.data), {
4545
cause: error,
4646
});
4747
}

src/domain/reserveSeats/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const createSeatsReservation = async ({
2727
});
2828
return data;
2929
} catch (error) {
30-
throw Error(JSON.stringify((error as AxiosError).response?.data), {
30+
throw new Error(JSON.stringify((error as AxiosError).response?.data), {
3131
cause: error,
3232
});
3333
}
@@ -48,7 +48,7 @@ export const updateSeatsReservation = async ({
4848
});
4949
return data;
5050
} catch (error) {
51-
throw Error(JSON.stringify((error as AxiosError).response?.data), {
51+
throw new Error(JSON.stringify((error as AxiosError).response?.data), {
5252
cause: error,
5353
});
5454
}

src/domain/signup/utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const fetchSignup = async (
6868
return data;
6969
} catch (error) {
7070
/* istanbul ignore next */
71-
throw Error(JSON.stringify((error as AxiosError).response?.data), {
71+
throw new Error(JSON.stringify((error as AxiosError).response?.data), {
7272
cause: error,
7373
});
7474
}
@@ -89,7 +89,7 @@ export const createSignups = async ({
8989
});
9090
return data;
9191
} catch (error) {
92-
throw Error(JSON.stringify((error as AxiosError).response?.data), {
92+
throw new Error(JSON.stringify((error as AxiosError).response?.data), {
9393
cause: error,
9494
});
9595
}
@@ -109,7 +109,7 @@ export const deleteSignup = async ({
109109
});
110110
return data;
111111
} catch (error) {
112-
throw Error(JSON.stringify((error as AxiosError).response?.data), {
112+
throw new Error(JSON.stringify((error as AxiosError).response?.data), {
113113
cause: error,
114114
});
115115
}
@@ -130,7 +130,7 @@ export const patchSignup = async ({
130130
});
131131
return data;
132132
} catch (error) {
133-
throw Error(JSON.stringify((error as AxiosError).response?.data), {
133+
throw new Error(JSON.stringify((error as AxiosError).response?.data), {
134134
cause: error,
135135
});
136136
}
@@ -151,7 +151,7 @@ export const updateSignup = async ({
151151
});
152152
return data;
153153
} catch (error) {
154-
throw Error(JSON.stringify((error as AxiosError).response?.data), {
154+
throw new Error(JSON.stringify((error as AxiosError).response?.data), {
155155
cause: error,
156156
});
157157
}

src/domain/signupGroup/utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ export const createSignupGroup = async ({
300300
});
301301
return data;
302302
} catch (error) {
303-
throw Error(JSON.stringify((error as AxiosError).response?.data), {
303+
throw new Error(JSON.stringify((error as AxiosError).response?.data), {
304304
cause: error,
305305
});
306306
}
@@ -318,7 +318,7 @@ export const fetchSignupGroup = async (
318318
return data;
319319
} catch (error) {
320320
/* istanbul ignore next */
321-
throw Error(JSON.stringify((error as AxiosError).response?.data), {
321+
throw new Error(JSON.stringify((error as AxiosError).response?.data), {
322322
cause: error,
323323
});
324324
}
@@ -338,7 +338,7 @@ export const deleteSignupGroup = async ({
338338
});
339339
return data;
340340
} catch (error) {
341-
throw Error(JSON.stringify((error as AxiosError).response?.data), {
341+
throw new Error(JSON.stringify((error as AxiosError).response?.data), {
342342
cause: error,
343343
});
344344
}
@@ -359,7 +359,7 @@ export const updateSignupGroup = async ({
359359
});
360360
return data;
361361
} catch (error) {
362-
throw Error(JSON.stringify((error as AxiosError).response?.data), {
362+
throw new Error(JSON.stringify((error as AxiosError).response?.data), {
363363
cause: error,
364364
});
365365
}

src/domain/singups/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const fetchSignups = async (
4646
return data;
4747
} catch (error) {
4848
/* istanbul ignore next */
49-
throw Error(JSON.stringify((error as AxiosError).response?.data), {
49+
throw new Error(JSON.stringify((error as AxiosError).response?.data), {
5050
cause: error,
5151
});
5252
}

src/domain/user/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const fetchUser = async (
1717
return data;
1818
} catch (error) {
1919
/* istanbul ignore next */
20-
throw Error(JSON.stringify((error as AxiosError).response?.data), {
20+
throw new Error(JSON.stringify((error as AxiosError).response?.data), {
2121
cause: error,
2222
});
2323
}

0 commit comments

Comments
 (0)