Skip to content

Instantly share code, notes, and snippets.

@rgabaydullov
Created August 25, 2020 09:23
Show Gist options
  • Save rgabaydullov/634d1c12cace699f4040dfe7b63ec422 to your computer and use it in GitHub Desktop.
Save rgabaydullov/634d1c12cace699f4040dfe7b63ec422 to your computer and use it in GitHub Desktop.
Vue error handling example
/* учитывайте, что глобальный метод window.onerror
не будет ловить исключения без Vue.config.errorHandler */
Vue.config.errorHandler = (error, vm, info) => {
return middlewareErrorHandler(error, info);
}
// сюда попадут все ошибки, которые находятся за пределами исполнения Vue
window.onerror = (
message,
source,
line,
column,
error,
) => {
return middlewareErrorHandler(message, error);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment