mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
global error handling in order to reload page on chunk failed
This commit is contained in:
committed by
Aiden McClelland
parent
9d14d47cfd
commit
db39e4432a
13
ui/src/app/services/global-error-handler.service.ts
Normal file
13
ui/src/app/services/global-error-handler.service.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { ErrorHandler, Injectable } from '@angular/core'
|
||||
|
||||
@Injectable()
|
||||
export class GlobalErrorHandler implements ErrorHandler {
|
||||
|
||||
handleError (error: any): void {
|
||||
const chunkFailedMessage = /Loading chunk [\d]+ failed/
|
||||
|
||||
if (chunkFailedMessage.test(error.message)) {
|
||||
window.location.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user