How to use the @converse/headless/log.fatal function in @converse/headless

To help you get started, we’ve selected a few @converse/headless examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github conversejs / converse.js / src / headless / converse-core.js View on Github external
}

    _converse.router.route(
        /^converse\?loglevel=(debug|info|warn|error|fatal)$/, 'loglevel',
        l => log.setLogLevel(l)
    );

    /* Localisation */
    if (i18n === undefined || _converse.isTestEnv()) {
        _converse.locale = 'en';
    } else {
        try {
            _converse.locale = i18n.getLocale(settings.i18n, _converse.locales);
            await i18n.fetchTranslations(_converse);
        } catch (e) {
            log.fatal(e.message);
        }
    }

    // Module-level variables
    // ----------------------
    this.callback = callback || function noop () {};
    /* When reloading the page:
     * For new sessions, we need to send out a presence stanza to notify
     * the server/network that we're online.
     * When re-attaching to an existing session we don't need to again send out a presence stanza,
     * because it's as if "we never left" (see onConnectStatusChanged).
     * https://github.com/jcbrand/converse.js/issues/521
     */
    this.send_initial_presence = true;
    this.user_settings = settings; // Save the user settings so that they can be used by plugins
github conversejs / converse.js / src / converse-profile.js View on Github external
.catch((err) => {
                    log.fatal(err);
                    _converse.api.show('error', __('Error'), [
                        __("Sorry, an error happened while trying to save your profile data."),
                        __("You can check your browser's developer console for any error output.")
                    ]);
                });
                this.modal.hide();
github conversejs / converse.js / src / converse-chatview.js View on Github external
async refreshContact (ev) {
                if (ev && ev.preventDefault) { ev.preventDefault(); }
                const refresh_icon = this.el.querySelector('.fa-refresh');
                u.addClass('fa-spin', refresh_icon);
                try {
                    await _converse.api.vcard.update(this.model.contact.vcard, true);
                } catch (e) {
                    log.fatal(e);
                    this.alert(__('Sorry, something went wrong while trying to refresh'), 'danger');
                }
                u.removeClass('fa-spin', refresh_icon);
            },
github conversejs / converse.js / src / converse-muc-views.js View on Github external
onCommandError (err) {
                log.fatal(err);
                this.showErrorMessage(__("Sorry, an error happened while running the command. Check your browser's developer console for details."));
            },