1
00:00:00,960 --> 00:00:09,420
And once we check for duplicate value now let's quickly talk about our custom API ones so our glasses

2
00:00:09,960 --> 00:00:16,470
and we can actually remove this if statement right now because remember, in the custom error, we are

3
00:00:16,470 --> 00:00:18,090
checking for status code.

4
00:00:18,420 --> 00:00:25,710
So if that property is on the object and beautiful, we set our status code value and the same goes

5
00:00:25,710 --> 00:00:26,370
for message.

6
00:00:26,790 --> 00:00:31,320
And in order to showcase that, I'm just going to remove this statement for the time being.

7
00:00:31,320 --> 00:00:36,050
I'll just count it out just so I can always put it back if I'm wrong.

8
00:00:36,420 --> 00:00:37,860
And then as far as the out.

9
00:00:37,880 --> 00:00:42,960
Well, let's take a look at our art charts, and I believe we're using it in a login.

10
00:00:43,230 --> 00:00:43,650
Correct.

11
00:00:43,900 --> 00:00:46,310
We have our bad request error.

12
00:00:46,590 --> 00:00:48,590
So let's try it out now.

13
00:00:48,600 --> 00:00:55,950
Of course, I'm going to go to login user and I'll try to get a token for Susan without providing the

14
00:00:55,950 --> 00:00:56,430
password.

15
00:00:56,640 --> 00:00:57,680
So let me remove it.

16
00:00:57,840 --> 00:00:59,250
Let me send it over here.

17
00:00:59,430 --> 00:01:03,450
And of course, I still have please provide email and password.

18
00:01:03,720 --> 00:01:07,560
And of course the error code re status code is also good.

19
00:01:07,710 --> 00:01:14,190
It is four hundred, which simply means that of course our logic works because again we have this custom

20
00:01:14,190 --> 00:01:20,160
error one and essentially we're looking for status code property on the error object that's coming in

21
00:01:20,580 --> 00:01:26,190
because remember in here, of course we're setting up a new one and the same goes for message so you

22
00:01:26,190 --> 00:01:27,810
can simply remove this code.

23
00:01:28,060 --> 00:01:32,520
Now, I'll leave this one for your reference, just in case you want to use it.

24
00:01:32,760 --> 00:01:35,580
But effectively, we don't need to use this anymore.

25
00:01:35,820 --> 00:01:42,620
And of course, with our new setup, we don't need to import the custom API, our class as well.

26
00:01:42,630 --> 00:01:46,050
So you can remove it and the code will still work.

