Skip to content

Commit 3ff725c

Browse files
authored
[events] Prevent newlines/long values in error titles (#4260)
1 parent fe22dbe commit 3ff725c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/sentry/eventtypes/error.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import absolute_import
22

33
from sentry.utils.safe import trim
4+
from sentry.utils.strings import truncatechars
45

56
from .base import BaseEvent
67

@@ -21,4 +22,7 @@ def get_metadata(self):
2122
}
2223

2324
def to_string(self, metadata):
24-
return u'{}: {}'.format(metadata['type'], metadata['value'])
25+
return u'{}: {}'.format(
26+
metadata['type'],
27+
truncatechars(metadata['value'].splitlines()[0], 100),
28+
)

0 commit comments

Comments
 (0)