Revert "fix(core): ErrorHandler should not rethrow an error by default (#13534)"
This reverts commit 1aebea52e1acf63e6fb0bda6cfa1f2c5bb00badb.
This commit is contained in:
parent
1aebea52e1
commit
601494734c
@ -41,7 +41,12 @@ export class ErrorHandler {
|
|||||||
*/
|
*/
|
||||||
_console: Console = console;
|
_console: Console = console;
|
||||||
|
|
||||||
constructor(private rethrowError: boolean = false) {}
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
rethrowError: boolean;
|
||||||
|
|
||||||
|
constructor(rethrowError: boolean = true) { this.rethrowError = rethrowError; }
|
||||||
|
|
||||||
handleError(error: any): void {
|
handleError(error: any): void {
|
||||||
this._console.error(`EXCEPTION: ${this._extractMessage(error)}`);
|
this._console.error(`EXCEPTION: ${this._extractMessage(error)}`);
|
||||||
@ -66,6 +71,8 @@ export class ErrorHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We rethrow exceptions, so operations like 'bootstrap' will result in an error
|
||||||
|
// when an error happens. If we do not rethrow, bootstrap will always succeed.
|
||||||
if (this.rethrowError) throw error;
|
if (this.rethrowError) throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user