Created
September 30, 2019 21:19
-
-
Save demsey2/a92f9212f123b2501a11f27cc5d7f78e to your computer and use it in GitHub Desktop.
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
import { ErrorHandler } from '@angular/core'; | |
@Injectable() | |
export class GlobalErrorHandler implements ErrorHandler { | |
handleError(error: any): void { | |
const chunkFailedMessage = /Loading chunk [\d]+ failed/; | |
if (chunkFailedMessage.test(err.message)) { | |
window.location.reload(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment