最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to handle ERR_NAME_NOT_RESOLVED error - Stack Overflow

programmeradmin2浏览0评论

I have some task depending to healthcheck endpoint. I need to get some response from backend or get net::ERR_NAME_NOT_RESOLVED this error if we outside some network.

Currently i trying to send request to my endpoint and locally i get error with status: 0 but on the live server i've got TypeError. Any ideas how i can handle net::ERR_NAME_NOT_RESOLVED?

p.s. no matter what request im using, fetch and xmlhttprequest doesnt work to

UPD: On the live server i can get CORS error from back-end but its ok for me, and im sure that i have access to other endpoints. Locally and outside the network ill get net::ERR_NAME_NOT_RESOLVED

I have some task depending to healthcheck endpoint. I need to get some response from backend or get net::ERR_NAME_NOT_RESOLVED this error if we outside some network.

Currently i trying to send request to my endpoint and locally i get error with status: 0 but on the live server i've got TypeError. Any ideas how i can handle net::ERR_NAME_NOT_RESOLVED?

p.s. no matter what request im using, fetch and xmlhttprequest doesnt work to

UPD: On the live server i can get CORS error from back-end but its ok for me, and im sure that i have access to other endpoints. Locally and outside the network ill get net::ERR_NAME_NOT_RESOLVED

Share edited Dec 17, 2021 at 23:43 sideshowbarker 88.6k30 gold badges215 silver badges212 bronze badges asked Dec 17, 2021 at 12:26 Igor ZinchenkoIgor Zinchenko 3731 gold badge4 silver badges19 bronze badges 2
  • If you find a solution to your problem, I would be very grateful if you could share it. – Mehrshad Farzaneh Commented Feb 5, 2022 at 7:28
  • @MehrshadFarzaneh its impossible on FE app because it's a network-level error. – Igor Zinchenko Commented May 18, 2024 at 13:11
Add a ment  | 

2 Answers 2

Reset to default 1

Clear your browser cookies: Browser cookies can block your Internet DNS and then cause the ERR_NAME_NOT_RESOLVED error. You can try clearing browser cookies to fix this error.

Or

Flush and renew DNS Flushing and renewing DNS is a very good way to fix the ERR_NAME_NOT_RESOLVED error — this method is quite easy to perform and it is very effective.

In a front-end application, you can't directly handle this error because it's a network-level error.

发布评论

评论列表(0)

  1. 暂无评论