Skip to content

Commit 848cb64

Browse files
committed
fix: Replace UnauthorizedException with NotFoundException for better error handling in report retrieval
1 parent d96968f commit 848cb64

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

backend/src/reports/reports.controller.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
Req,
1010
UnauthorizedException,
1111
Post,
12+
NotFoundException,
1213
} from '@nestjs/common';
1314
import {
1415
ApiTags,
@@ -83,11 +84,11 @@ export class ReportsController {
8384
const report = await this.reportsService.findOne(id, userId);
8485

8586
if (!report) {
86-
throw new UnauthorizedException('Report not found');
87+
throw new NotFoundException('Report not found');
8788
}
8889

8990
if (report.processingStatus === ProcessingStatus.FAILED) {
90-
throw new UnauthorizedException('Processing failed');
91+
throw new NotFoundException('Processing failed');
9192
}
9293

9394
return report;

0 commit comments

Comments
 (0)