[0:00] everybody is talking about deep seek AI [0:02] compared to chat GPT so I thought to [0:04] give it a try as well I have a piece of [0:06] code here this code is basically one of [0:09] the function for our one of the project [0:12] in our course and this is a API end [0:15] point calling function that is basically [0:18] used by entire API calling method within [0:21] the application so this is a functional [0:24] code but it is not fully completed and [0:27] it has some BG to fix and I have written [0:30] some prompt here for ai2 analyze it and [0:33] give me some feedback or provide me the [0:35] solution and I want to give this exact [0:37] same instruction and the code to the [0:41] both charity and then dips and then see [0:43] how it works so I have a Char open here [0:45] in Incognito and I tried to open the [0:47] dips into the Cognito but it won't allow [0:51] so this is a really smart way to kind of [0:53] saving the server cost I hope they are [0:54] not doing that but yeah going back to I [0:57] have to log in so I log in here so I [1:00] haven't done any really much use of [1:02] deeps so what I like to do is let's copy [1:05] this out entire code and then I'm going [1:07] to go to a platform here and then I'm [1:09] going to pass that to GPD first hit [1:12] enter or submit it and then give to the [1:14] dsck as well and let's see what happens [1:18] all right still processing it [1:21] and let's analyze it which one doing the [1:26] good job here this see is bit slow so oh [1:30] looks like he's writing very detailed [1:32] information so while it's just doing its [1:34] job let's go and look into GPT and then [1:36] see what it says so here are few Su [1:39] modify the error handling logic here in [1:41] the logic check for the user should be [1:43] logged out should only be trigger for [1:46] the authentication error like 44 should [1:49] be based on the S and condition I.E non [1:52] expir okay yeah so additionally better [1:55] code handling is implementing status [1:58] code 400 verify that it is actually [2:00] correct XO doesn't have the status [2:02] property directly blah blah blah and [2:05] doesn't really give you detail there so [2:08] scrolling down here I want to see so [2:13] basically it has written another TR [2:17] catch [2:18] block inside my catch block and which I [2:21] already don't like it and um nesting [2:25] more cord here I don't really enjoy this [2:28] approach and also of course uh doing [2:30] other few check okay guys if you are [2:33] quer you know what's going on here I got [2:35] enough information what he's trying to [2:37] give me and which is I'm not really [2:39] happy here now I'm going to go back to [2:42] this deep sick and then very first time [2:45] I'm literally using this for cord [2:47] analysis let's see what it has to say [2:50] okay this is exactly the issue it has [2:52] given very like to the point problem [2:56] which I did not really see here did we [2:59] see that so I do not see GPT giving me [3:02] the exact location or the exact message [3:06] where the issue is like here it has [3:08] saying the behavior likely to doe to the [3:11] else Block in the cat section of your [3:14] API processor the function which removes [3:16] the JWT token from the storage whenever [3:19] an error occurs regardless of the error [3:22] type yeah that is the actual problem [3:24] here so if you look into this Cod [3:27] whenever we have the server site 400 [3:30] error and then only that comes up with [3:32] the just JWT expired then we are [3:35] basically rerunning the code after [3:36] fetching the new token other than that [3:39] we are just deleting the token that was [3:41] the problem so that was smart now [3:44] looking into the error handle link okay [3:46] here the code now only removes the JWT [3:49] token and logs out user uh if the error [3:52] is 44 on authorize 043 error basically [3:56] it locks out every anything okay it has [3:58] given to the point Point solution here [4:01] you should only remove the JWT tokens [4:03] and log the user out when the error is [4:06] specifically related to the [4:08] authentication that's correct but 401 [4:10] authorized or 43 forbidden and not for [4:13] other type of yeah that's the solution [4:15] kind of we are looking for but here is [4:17] the modified code I'm going to go [4:21] straight away and then look into the [4:23] catch section at least it's not putting [4:25] another try catch here inside the catch [4:27] which I'm okay it looks for the message [4:29] okay it's just checking if condition so [4:31] it's going to run this cord only when [4:34] that condition pass if the cord goes [4:36] inside here it will stop here so it this [4:39] will not run so if that doesn't pass [4:41] through then it's going to check 401 [4:44] error response status s is [4:46] 43 then you can delete this I think yeah [4:52] honestly the solution comparing to I'm [4:55] going to go back to chat JP quickly one [4:56] more time to see the solution it's do [4:59] pretty much similar thing but this is [5:01] way messy Cod I would say honestly I do [5:04] like the way the Deep SE has given the [5:07] solution here comparatively the chat GPT [5:12] solution okay that's my opinion over [5:15] these two different tools guys what do [5:17] you think let me know in the comment