Exemple #1
0
    def recordSignal(self, sig_num, sig_frame):
        """
        Given the two values passed into a `signal` handler, record an occurence of the signal.
        """
        if self.disabled:
            return

        occ = Occurrence.from_signal(sig_num, sig_frame)
        self.record(occ)
Exemple #2
0
    def recordException(self, exc_type, exc_value, exc_traceback):
        """
        Given the three values passed into :func:`sys.excepthook` or obtainable from :func:`sys.exc_info`,
        record an occurrence of the exception.

        This may be called by the application to report a nonfatal exception.
        """
        if self.disabled:
            return

        if exc_type.__name__ in self.ignoredExceptions or exc_type in self.ignoredExceptions:
            return

        occ = Occurrence.from_exception(exc_type, exc_value, exc_traceback)
        self.record(occ)