your backend is working? don't get time out error?
Yes it's working fine
you are not using ; to end statements. thay may cause the problem
That isn't the problem cause semicolon is optional in js. Anyways this problem got sorted
Now everything's working fine but still the catch block is running
at some place it isn't optional. so better use it always.
Final question for today 🗿👆
means the promise is getting rejected somehow.
Yup it again turned out to be a silly mistake
Why use try/catch/finally?
Try executes normally. If there's a error it goes under catch. And finally block runs regardless of error occurred or not
Yeah Ik but I don't think it's needed for requests I always use const res = fetch if (res) { // Ok response and error handling logic }
Hmm idk exactly but everyone uses try catch
Try catch isn't just for fetch. It can be for any type of code
Yeah I always use it in the backend, but never for requests
Обсуждают сегодня