SykoDaedalus left a comment (openstreetmap/openstreetmap-website#6724)

> I was thinking of something like
> 
> ```js
>         throw new Error("Response not OK", { cause: {
>           status: response.status,
>           statusText: response.statusText,
>           text: await response.text()
>         } });
> ```
> 
> and handle that in the `catch` block in the vicinity of this code
> 
> https://github.com/openstreetmap/openstreetmap-website/blob/70c2269f5b9c7112998d6443c038591f23763425/app/assets/javascripts/index/query.js#L243

Respone text is something like - `<p><strong 
style="color:#FF0000">Error</strong>: runtime error: open64: 0 Success 
/osm3s_osm_base Dispatcher_Client::request_read_and_idx::timeout. The server is 
probably too busy to handle your request. </p>`
While there is useful information in the response, it's wrapped in HTML and 
would need parsing to extract. `statusText` already provides a reasonable error 
message, I feel the added complexity of HTML parsing might not be worth it? 
However, I can implement it if it can help in debugging the code.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6724#issuecomment-3779702919
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/pull/6724/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to