drunomics / nuxtjs-drupal-ce

A Nuxt module to easily connect Drupal via custom elements.
https://lupus-decoupled.org/
MIT License
22 stars 4 forks source link

Improve handling of the server errors #202

Closed vloss3 closed 2 months ago

vloss3 commented 3 months ago

Motivation / Goals

The server errors are currently not being properly logged to stderr or displaying information about requests failing, example for route rules proxy error showing incorrectly:

[nuxt] [request error] [unhandled] [500] fetch failed
  at Object.fetch (node:internal/deps/undici/undici:11730:11)  
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)  
  at async sendProxy (./server/chunks/runtime.mjs:2494:20)  
  at async Object.handler (./server/chunks/runtime.mjs:7751:10)  
  at async Object.handler (./server/chunks/runtime.mjs:2861:19)  
  at async toNodeHandle (./server/chunks/runtime.mjs:3127:7)  
  at async ufetch (./server/chunks/runtime.mjs:3493:17)  
  at async $fetchRaw2 (./server/chunks/runtime.mjs:3365:26)  
  at async $fetch2 (./server/chunks/runtime.mjs:3407:15)  
  at async fetchPage (./server/chunks/build/server.mjs:4520:35)

Requirements

fago commented 3 months ago

Would be nice when debug mode in nuxt is active to have stdout output like

[404] https://my.drupal.com/ce-api/api/menu/main

fago commented 3 months ago

For proxies - would it make sense to proxy 5xx errors? For general fetch requests, is the error handling for 5xx better then?