Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

321
Vistas
how to handle errors in quasar boot files

In our quasar application we have a few boot files, some of them can run into an exception which should block the application from starting normally, instead an error should be displayed.

Is there some best-practice for such a case? I didn't find much in the documentation.

My approach was the following, if an error occurs forward/redirect to an error page and display the error.

I need to somehow pass the error to the error-page:

  • passing the message as GET parameter would be a bad idea => XSS
  • I also cannot pass an error ID/Key because the error may come from a server with various messages
  • Storing the error in a vuex store does not work because the store is reset after reject() is called.

So I was thinking maybe there is a better way of doing handling errors in boot files? Stop current booting and goto error-page...

Here is an reduced example which will end in the /error page but with the store.error empty, reject() will reboot the application reset the store.

export default ({ app, store, urlPath }) => {
  // required to prevent invinite loop, the reject(url) will reboot application
  if (urlPath.indexOf("error") !== -1) {
    // TODO be more specific then indexOf("error")
    return;
  }

  return new Promise((resolve, reject) => {
    doSomeServerCommunication()
      .then((result) => {
        resolve();
      })
      .catch((e) => {
        store.commit("appStore/updateError", e);
        reject({ url: window.location.origin + "/app/error" });
        return;
      });
  });
};
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda