mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 12:33:40 +00:00
14 lines
332 B
TypeScript
14 lines
332 B
TypeScript
import { ErrorHandler, Injectable } from '@angular/core'
|
|
|
|
@Injectable()
|
|
export class GlobalErrorHandler implements ErrorHandler {
|
|
|
|
handleError (e: any): void {
|
|
console.error(e)
|
|
const chunkFailedMessage = /Loading chunk [\d]+ failed/
|
|
|
|
if (chunkFailedMessage.test(e.message)) {
|
|
window.location.reload()
|
|
}
|
|
}
|
|
} |