cretueusebiu / vform

Handle Laravel-Vue forms and validation with ease.
https://vform.vercel.app
MIT License
610 stars 122 forks source link

customize 500 error response... #125

Closed quyle92 closed 3 years ago

quyle92 commented 3 years ago

Hi there, Is there any way where I can customize the response message for 500 Internal Server Error? At the moment when sth goes wrong in the backend, it will show up laravel generated message, but I want it to display general message like "Sth went wrong with the system, please contact your admin". How am I able to achieve that? Thank you...

nguyentranchung commented 3 years ago
axios.interceptors.response.use(
  (response) => response,
  (error: AxiosError) => {
    const status = error?.response?.status || 0;

    if (status >= 500) {
      // handle
   }
  }
);