Ошибки, которые объясняют, а не обвиняют: написание сообщения "эта ссылка не сработала"

DEV · 22.11.2026 · 10:49

Первая версия моего загрузчика показывала одно сообщение при каждой ошибке, которое не давало полезной информации пользователю. Я понял, что код может предоставить больше данных о причине…

Читать в источнике

Оригинал

Error states that explain instead of blame: writing the "this link did not work" message

The first version of my downloader showed one message for every failure: "Error. Try again." It was honest in a narrow sense — something had gone wrong — but it told the visitor nothing useful. A deleted video, a private post, a provider outage and a mistyped link all looked the same, so every failure felt like the site was broken. People left. I do not blame them. The problem was that my code knew much more than it was saying. The provider's response usually contained a reason, or at least a s