'Exception ocurred in the internal console.
Show a QMessageBox or the internal console to warn the user'

def exception_occurred(self, text, is_traceback):

    if ((not is_traceback) and (self.msgbox_traceback is None)):
        return
    if CONF.get('main', 'show_internal_console_if_traceback', False):
        self.dockwidget.show()
        self.dockwidget.raise_()
    else:
        if (self.msgbox_traceback is None):
            self.msgbox_traceback = QMessageBox(QMessageBox.Critical, _('Error'), _('<b>Spyder    has    encountered    a    problem.</b><br>Sorry    for    the    inconvenience.<br><br>You    can    automatically    submit    this    error    to    our    Github    issues    tracker.<br><br><i>Note:</i>    You    need    a    Github    account    for    that.'), QMessageBox.Ok, parent=self)
            self.submit_btn = self.msgbox_traceback.addButton(_('Submit    to    Github'), QMessageBox.YesRole)
            self.submit_btn.pressed.connect(self.press_submit_btn)
            self.msgbox_traceback.setWindowModality(Qt.NonModal)
            self.error_traceback = ''
            self.msgbox_traceback.show()
            self.msgbox_traceback.finished.connect(self.close_msg)
            self.msgbox_traceback.setDetailedText('    ')
            for button in self.msgbox_traceback.buttons():
                if (self.msgbox_traceback.buttonRole(button) == QMessageBox.ActionRole):
                    button.click()
                    break
        self.error_traceback += text
        self.msgbox_traceback.setDetailedText(self.error_traceback)
