[Vuejs]-Internal Server Error on failed in router

0👍

Hmmm, Ok, I do it

on error:

(error) => {
              HelpersService.internalServerErrorToast();
              next(false);
            }

in service:

  internalServerErrorToast() {
    let bootStrapToaster = new BToast();

    bootStrapToaster.$bvToast.toast("500", {
      title: "Internal Server Error",
      toaster: "b-toaster-bottom-right",
      solid: true,
      variant: "danger",
      appendToast: false,
      noCloseButton: true,
      toastClass: "internalErrorToast",
    });
  }

0👍

Why you are not using catch. If you are using then, you can use catch.

beforeEnter: function(to, form, next) {
    this.getData().then((response) => {
        next();
    }).catch(error => {
         throw error
    })

}

Try this. If not work, comment, We will do something else.

Leave a comment