Created
August 25, 2020 09:23
-
-
Save rgabaydullov/634d1c12cace699f4040dfe7b63ec422 to your computer and use it in GitHub Desktop.
Vue error handling example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* учитывайте, что глобальный метод 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