Browse Source

Trim error metadata (and coerce string)

David Cramer 8 years ago
parent
commit
9bf98b28b0
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/sentry/eventtypes/error.py

+ 5 - 2
src/sentry/eventtypes/error.py

@@ -1,5 +1,7 @@
 from __future__ import absolute_import
 
+from sentry.utils.safe import trim
+
 from .base import BaseEvent
 
 
@@ -12,7 +14,8 @@ class ErrorEvent(BaseEvent):
     def get_metadata(self):
         exception = self.data['sentry.interfaces.Exception']['values'][0]
 
+        # in some situations clients are submitting non-string data for these
         return {
-            'type': exception.get('type', 'Error'),
-            'value': exception.get('value', ''),
+            'type': trim(exception.get('type', 'Error'), 128),
+            'value': trim(exception.get('value', ''), 1024),
         }