Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

319
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!