From 68adcc3c642779ca3b8950dc7e18885dad28efb7 Mon Sep 17 00:00:00 2001 From: Shaalan Marwan Date: Fri, 29 Apr 2022 04:58:38 +0300 Subject: [PATCH] add not found exception --- src/tasks/tasks.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tasks/tasks.service.ts b/src/tasks/tasks.service.ts index be36115..82f5bd6 100644 --- a/src/tasks/tasks.service.ts +++ b/src/tasks/tasks.service.ts @@ -42,7 +42,7 @@ export class TasksService { getTaskById(id: string): Task { const task = this.tasks.find((task) => task.id === id); if (!task) { - throw new NotFoundException(); + throw new NotFoundException(`Task with ID ${id} not found`); } return task; }