Skip to content

Commit abfb9d0

Browse files
committed
PM-1073 - throw forbid exception
1 parent c603a5f commit abfb9d0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/api/webhooks/webhooks.controller.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import {
22
Controller,
33
Post,
4-
BadRequestException,
54
Req,
65
RawBodyRequest,
6+
ForbiddenException,
77
} from '@nestjs/common';
88
import { ApiTags } from '@nestjs/swagger';
99
import { TrolleyService } from './trolley/trolley.service';
@@ -24,7 +24,7 @@ export class WebhooksController {
2424
*
2525
* @param request - The incoming webhook request containing headers, raw body, and parsed body.
2626
* @returns A success message if the webhook is processed successfully.
27-
* @throws {BadRequestException} If the signature is invalid or the webhook has already been processed.
27+
* @throws {ForbiddenException} If the signature is invalid or the webhook has already been processed.
2828
*/
2929
@Post('trolley')
3030
async handleTrolleyWebhook(@Req() request: RawBodyRequest<Request>) {
@@ -34,7 +34,7 @@ export class WebhooksController {
3434
request.rawBody?.toString('utf-8') ?? '',
3535
)
3636
) {
37-
throw new BadRequestException('Missing or invalid signature!');
37+
throw new ForbiddenException('Missing or invalid signature!');
3838
}
3939

4040
// do not proceed any further if event has already been processed

0 commit comments

Comments
 (0)