Похожие чаты

Anything after the fetch function isn't working but it's still

sending data to the backend. What could be the reason? I've searched everywhere but couldn't get any solution

15 ответов

2 просмотра

your backend is working? don't get time out error?

Saurav- Автор вопроса

you are not using ; to end statements. thay may cause the problem

Saurav- Автор вопроса
MG
you are not using ; to end statements. thay may ca...

That isn't the problem cause semicolon is optional in js. Anyways this problem got sorted

Saurav- Автор вопроса

Now everything's working fine but still the catch block is running

Saurav
That isn't the problem cause semicolon is optional...

at some place it isn't optional. so better use it always.

Saurav- Автор вопроса
Saurav
Now everything's working fine but still the catch ...

means the promise is getting rejected somehow.

Saurav- Автор вопроса
MG
means the promise is getting rejected somehow.

Yup it again turned out to be a silly mistake

Why use try/catch/finally?

Saurav- Автор вопроса
Dvin Avanesian
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

Saurav
Try executes normally. If there's a error it goes ...

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 }

Saurav- Автор вопроса
Saurav- Автор вопроса
Dvin Avanesian
Yeah Ik but I don't think it's needed for requests...

Try catch isn't just for fetch. It can be for any type of code

Saurav
Try catch isn't just for fetch. It can be for any ...

Yeah I always use it in the backend, but never for requests

Похожие вопросы

Обсуждают сегодня

------------------------------------------------------------------------------ 📢 MAJOR ANNOUNCEMENT: HSUITE ECOSYSTEM UPDATE 📢 @everyone Dear HbarSuite Community, After month...
Big Stones
3
Ready for some fun AND a chance to win TKO Tokens? Join us for exciting minigames in our Telegram group! 🕒 Don’t miss out—games start on today 25 October 2024, at 8 PM! Ge...
Milkyway | Tokocrypto
248
Здравствуйте, вопрос по структурам данных. Были у вас случаи, когда пришлось писать деревья или двунаправленные списки?
/ /
48
Всем привет! Скажите, никто не пытался уменьшить размер процесса ssl, которые ассоциируется с открытым соединением (не помню точное название этого процесса, но там была какая-...
Алексей
20
Let's say the current price of BCH is 400$, and average fee for transaction is .1$ If the price jumps to let's say 4000$, transaction fee should be 1$ ? I don't know exactly ...
Mohamed
22
Мне тут приспичило встроить в программу форматировние текста SQL, расставить переносы строк и отступы так, чтобы лучше читалось. Я что-то свое изобразил, оно после ключевых сл...
Sergey Bodrov
11
а проверьте, собирается ли у кого сейчас транк лазаря через делюкс? у меня вот: fpcupdeluxe: info: Lazarus Native Installer (BuildModuleCustom: UserIDE): LazBuild: building Us...
Iluha Companets
20
why not complete my galxe task??
Crypto 6827
13
добрый день. возможно ли изменить цвет окон лазаруса? Как?
Budemposmotret
35
This is a big issue. Just by being a citizen of a country, you are denied to contribute to Open Source software: https://youtu.be/L5Ec5jrpLVk?si=1iIuHnMPbCB4anV-
Sharuzzaman Ahmat Raslan
72
Карта сайта