Skip to content

Instantly share code, notes, and snippets.

@demsey2
Created September 30, 2019 21:19
Show Gist options
  • Save demsey2/a92f9212f123b2501a11f27cc5d7f78e to your computer and use it in GitHub Desktop.
Save demsey2/a92f9212f123b2501a11f27cc5d7f78e to your computer and use it in GitHub Desktop.
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