Check if console.error
is defined
This commit is contained in:
@ -15,7 +15,12 @@ export function stringify(obj: any): string {
|
||||
|
||||
export function onError(e: any) {
|
||||
// TODO: (misko): We seem to not have a stack trace here!
|
||||
console.error(e, e.stack);
|
||||
if (console.error) {
|
||||
console.error(e, e.stack);
|
||||
} else {
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log(e, e.stack);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user