@@ -105,20 +105,6 @@ def __init__(self) -> None:
105
105
def emit (self , record : logging .LogRecord ) -> None :
106
106
report : Dict [str , Any ] = {}
107
107
108
- # This parameter determines whether Zulip should attempt to
109
- # send Zulip messages containing the error report. If there's
110
- # syntax that makes the Markdown processor throw an exception,
111
- # we really don't want to send that syntax into a new Zulip
112
- # message in exception handler (that's the stuff of which
113
- # recursive exception loops are made).
114
- #
115
- # We initialize is_markdown_rendering_exception to `True` to
116
- # prevent the infinite loop of Zulip messages by ERROR_BOT if
117
- # the outer try block here throws an exception before we have
118
- # a chance to check the exception for whether it comes from
119
- # the Markdown processor.
120
- is_markdown_rendering_exception = True
121
-
122
108
try :
123
109
report ["node" ] = platform .node ()
124
110
report ["host" ] = platform .node ()
@@ -131,9 +117,6 @@ def emit(self, record: logging.LogRecord) -> None:
131
117
if record .exc_info :
132
118
stack_trace = "" .join (traceback .format_exception (* record .exc_info ))
133
119
message = str (record .exc_info [1 ])
134
- is_markdown_rendering_exception = record .msg .startswith (
135
- "Exception in Markdown parser"
136
- )
137
120
else :
138
121
stack_trace = "No stack trace available"
139
122
message = record .getMessage ()
@@ -142,7 +125,6 @@ def emit(self, record: logging.LogRecord) -> None:
142
125
# seem to result in super-long messages
143
126
stack_trace = message
144
127
message = message .split ("\n " )[0 ]
145
- is_markdown_rendering_exception = False
146
128
report ["stack_trace" ] = stack_trace
147
129
report ["message" ] = message
148
130
@@ -171,20 +153,13 @@ def emit(self, record: logging.LogRecord) -> None:
171
153
)
172
154
173
155
try :
174
- if settings .STAGING_ERROR_NOTIFICATIONS :
175
- # On staging, process the report directly so it can happen inside this
176
- # try/except to prevent looping
177
- from zerver .lib .error_notify import notify_server_error
178
-
179
- notify_server_error (report , is_markdown_rendering_exception )
180
- else :
181
- queue_json_publish (
182
- "error_reports" ,
183
- dict (
184
- type = "server" ,
185
- report = report ,
186
- ),
187
- )
156
+ queue_json_publish (
157
+ "error_reports" ,
158
+ dict (
159
+ type = "server" ,
160
+ report = report ,
161
+ ),
162
+ )
188
163
except Exception :
189
164
# If this breaks, complain loudly but don't pass the traceback up the stream
190
165
# However, we *don't* want to use logging.exception since that could trigger a loop.
0 commit comments