<commit_before>import {ExceptionHandler} from '@angular/core';
import {UxUtil} from "./uxutil";
import {Utilities} from "./utilities";

export class ExceptionHelper extends ExceptionHandler {
    call(exception: any, stackTrace?: any, reason?: string) {
        console.group(exception.description || 'Handled Exception');
        console.error(exception);
        console.groupCollapsed('Stack Trace');
        console.error(stackTrace);
        console.groupEnd();
        console.groupEnd();

        console.error("Exception = " + Utilities.stringifyPlusPlus(exception));
        console.error(exception);

        if (Utilities.stringifyPlusPlus(exception).indexOf('Attempt to use a destroyed view') >= 0) {
            return; // skip showing error notification to user.  silently swallow.
        }

        UxUtil.showErrorNotification("An unexpected error occurred.", [], exception);
    }
}<commit_msg>Just in case, add silent re-routing to home on route failures<commit_after>import {ExceptionHandler} from '@angular/core';
import {UxUtil} from "./uxutil";
import {Utilities} from "./utilities";

export class ExceptionHelper extends ExceptionHandler {
    call(exception: any, stackTrace?: any, reason?: string) {
        console.group(exception.description || 'Handled Exception');
        console.error(exception);
        console.groupCollapsed('Stack Trace');
        console.error(stackTrace);
        console.groupEnd();
        console.groupEnd();

        console.error("Exception = " + Utilities.stringifyPlusPlus(exception));
        console.error(exception);

        if (Utilities.stringifyPlusPlus(exception).indexOf('Attempt to use a destroyed view') >= 0) {
            return; // skip showing error notification to user.  silently swallow.
        }

        if (Utilities.stringifyPlusPlus(exception).indexOf("Uncaught (in promise): Error: Cannot match any routes: 'excel'") >= 0) {
            window.location.href = Utilities.playgroundBasePath;
            return;
        }

        UxUtil.showErrorNotification("An unexpected error occurred.", [], exception);
    }
}
{'fraction_non_alphanumeric': 0.1213707758210376, 'fraction_numerical': 0.0014278914802475012, 'mean_word_length': 3.325102880658436, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4425936', 'n_tokens_mistral': 527, 'n_tokens_neox': 520, 'n_words': 139}