h3 icon indicating copy to clipboard operation
h3 copied to clipboard

Non-graceful error when proxy is offline

Open TheAlexLichter opened this issue 10 months ago • 0 comments

Environment

  • Operating System: Darwin
  • Node Version: v21.6.2
  • Nuxt Version: -
  • CLI Version: 3.11.1
  • Nitro Version: -
  • Package Manager: [email protected]
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

  1. Use the h3 playground example
  2. Create a handler with the following code (StackBlitz won't work as it is about proxy):
eventHandler((event) => {
  let url = "http://some-non-existent.url.domain"
  return proxyRequest(event, url)
})
  1. Visit the route

Describe the bug

H3 responds with a 500 because the fetch request fails, either because the address can't be found or if the server is offline.

A more graceful way of handling would be nice 🤔

Additional context

No response

Logs

No response

TheAlexLichter avatar Mar 27 '24 19:03 TheAlexLichter