Пример #1
0
 def clean(self):
     if self.traceback:
         try:
             clean_traceback(self.traceback)
         except ValueError:
             error_message = "Invalid traceback. Please copy your entire traceback and " \
                             "paste here. It should start exactly as follow: " \
                             "'Traceback (most recent call last):'"
             raise ValidationError({'traceback': error_message})
Пример #2
0
 def save(self, *args, **kwargs):
     self.traceback = clean_traceback(self.traceback)
     self.sanitized_traceback = sanitize_traceback(self.traceback)
     self.parsed_traceback = ParsedException.from_string(
         self.sanitized_traceback
     ).to_dict()
     self.raised_by = self._get_raised_by()
     self.raised_by_line = self._get_raised_by_line()
     super(ErrorPost, self).save(*args, **kwargs)
Пример #3
0
 def clean(self):
     if self.traceback:
         try:
             clean_traceback(self.traceback)
         except ValueError as e:
             raise ValidationError({'traceback': e.message})