Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

320
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda