1
00:00:00,180 --> 00:00:07,470
OK, so why do we have these two responses, why we have four or four, we know tasked with the study

2
00:00:07,770 --> 00:00:10,350
and we still have the generic one?

3
00:00:10,560 --> 00:00:16,950
Well, simply because we can have two types of errors, and I'm not sure that we just need to navigate

4
00:00:16,950 --> 00:00:24,040
back to the postman and then notice where we have the problems, where I set up this long road.

5
00:00:24,360 --> 00:00:26,280
Why don't we try changing the last value?

6
00:00:26,610 --> 00:00:30,630
So instead of B that I have here, I'm going to go with zero.

7
00:00:30,930 --> 00:00:34,230
And once we send well, we should get the message.

8
00:00:34,470 --> 00:00:37,010
No task with blah, blah, blah.

9
00:00:37,650 --> 00:00:38,040
Why?

10
00:00:38,100 --> 00:00:44,100
Well, because, of course, in our database we don't have any item whose idea is matching.

11
00:00:44,430 --> 00:00:50,390
And I can clearly see the of for that means of course that that is our response.

12
00:00:50,400 --> 00:00:59,160
But if we change this around and then instead of keeping the same amount of characters, we start removing

13
00:00:59,160 --> 00:01:00,900
or adding, you'll see this error.

14
00:01:01,710 --> 00:01:04,730
And the name of this error is cast error.

15
00:01:05,069 --> 00:01:12,720
So effectively, what's happening if we have the correct syntax for the idea, but we cannot find the

16
00:01:12,720 --> 00:01:19,560
item, then of course we'll have to deal with ourselves because essentially there is no task with this

17
00:01:19,570 --> 00:01:20,060
idea.

18
00:01:20,310 --> 00:01:26,520
But if the ID is actually going to have the wrong syntax, meaning it's not going to match the amount

19
00:01:26,520 --> 00:01:31,800
of characters that Mongo's is looking for, then of course we will get the error from the Mongo's.

20
00:01:31,890 --> 00:01:38,460
And like I already mentioned, this is going to be somewhat common setup for us, for the upcoming controller

21
00:01:38,490 --> 00:01:44,850
as well, because for both of them for update task as well as the task, at the end of the day, we'll

22
00:01:44,850 --> 00:01:47,550
still have to find that one specific item.

23
00:01:47,940 --> 00:01:52,320
And if we're not successful, then we'll send back the final four.

24
00:01:52,500 --> 00:01:59,760
But we'll always have this generic one as well, just in case the actual syntax for the idea is totally

25
00:01:59,760 --> 00:01:59,990
off.

