3DStreet / 3dstreet

🚲🚢🚌 Web-based 3D visualization of streets using A-Frame
https://3dstreet.app
Other
250 stars 30 forks source link

Notify user when loading streetmix failed because of 503 Service Unavailable #549

Closed vincentfretin closed 1 week ago

vincentfretin commented 1 month ago

When I loaded the default streetmix scene, I ended up with an empty scene not knowing why. In the console I got the error https://streetmix.net/api/...net::ERR_FAILED 503 (Service Unavailable) The service was down for 5 minutes.

There is probably a missing check for status code when you download the streetmix file to properly show a message to the user that the download failed. I don't know where is the code that downloads the streetmix file.

In javascript with fetch, when status code is different than 20x there is no exception raised like it's the case Python for example. You need to check for res.ok and raise an exception yourself, for example

fetch(url, headers)
  .then((res) => {
    if (!res.ok) throw Error(res.statusText);
    return res.blob();
  })
vincentfretin commented 1 month ago

Also add a timeout for the fetch https://medium.com/deno-the-complete-reference/timeout-fetch-request-in-node-js-4231f33a9b95

kfarr commented 4 weeks ago

related https://github.com/3DStreet/3dstreet/issues/274

kfarr commented 1 week ago

closing duplicate