コード例 #1
0
 def handle_exception(self, inst):
     build = get_git_sha1_auto()
     stacktrace = "".join(_format_exc_info(*sys.exc_info()))
     msg = 'Build: {}\n{}'.format(build, stacktrace)
     p = ErrorPopup(details=msg)
     p.chain_open()
     return ExceptionManager.PASS
コード例 #2
0
def _protected_call(messagequeue, function, action_name, *args, **kwargs):
    try:
        Logger.info('Para: Starting new thread/process for: {}'.format(action_name))
        return function(messagequeue, *args, **kwargs)
    except Exception:
        stacktrace = "".join(_format_exc_info(*sys.exc_info()))
        error = 'An error occurred in a subprocess:\nBuild: {}\n{}'.format(get_git_sha1_auto(), stacktrace).rstrip()
        messagequeue.reject({'details': error})

    finally:
        Logger.info('Para: Closing thread/process for: {}'.format(action_name))
コード例 #3
0
    def wrapper(*args, **kwargs):
        try:
            try:
                func(*args, **kwargs)

            except (UnicodeEncodeError, UnicodeDecodeError) as ex:
                error_message = "{}. Original exception: {} Text: {}".format(
                    unicode(ex),
                    type(ex).__name__, repr(ex.args[1]))
                raise UnicodeError, UnicodeError(
                    error_message), sys.exc_info()[2]

        except Exception:
            build = get_git_sha1_auto()
            stacktrace = "".join(_format_exc_info(*sys.exc_info()))
            msg = 'Build: {}\n{}'.format(build, stacktrace)
            # p = ErrorPopup(details=msg)
            # p.open()
            MessageBox(msg, CRITICAL_POPUP_TITLE)
コード例 #4
0
        import sys
        error_message = "{}. Original exception: {} Text: {}".format(unicode(ex), type(ex).__name__, repr(ex.args[1]))
        raise UnicodeError, UnicodeError(error_message), sys.exc_info()[2]

except Exception:
    # Mega catch-all requirements
    # Try to catch all possible problems
    import sys
    exc_info = sys.exc_info()

    from utils.critical_messagebox import MessageBox

    CRITICAL_POPUP_TITLE = """An error occurred. Copy it with Ctrl+C and submit a bug"""
    try:
        from utils.primitive_git import get_git_sha1_auto
        build = get_git_sha1_auto()

    except:
        build = 'N/A (exception occurred)\nBuild exception reason:\n{}'.format(
            repr(sys.exc_info()[1])
        )

    try:
        from utils.testtools_compat import _format_exc_info
        stacktrace = "".join(_format_exc_info(*exc_info))

    except:
        try:
            import traceback
            last_chance_traceback = "\n".join(traceback.format_tb(exc_info[2]))
コード例 #5
0
 def update_footer_label(self, dt):
     git_sha1 = get_git_sha1_auto()
     footer_text = 'Version: {}\nBuild: {}'.format(
         self.version, git_sha1[:7] if git_sha1 else 'N/A')
     self.view.ids.footer_label.text = footer_text.upper()