@@ -209,7 +209,6 @@ def __call__(self, env, start_response):
209
209
env [_ENVIRON_ACTIVATION_KEY ] = activation
210
210
211
211
def _start_response (status , response_headers , * args , ** kwargs ):
212
- otel_wsgi .add_response_attributes (span , status , response_headers )
213
212
response = start_response (
214
213
status , response_headers , * args , ** kwargs
215
214
)
@@ -280,19 +279,19 @@ def process_response(
280
279
if resource is None :
281
280
status = "404"
282
281
reason = "NotFound"
283
-
284
- if _ENVIRON_EXC in req .env :
285
- exc = req .env [_ENVIRON_EXC ]
286
- exc_type = type (exc )
287
282
else :
288
- exc_type , exc = None , None
289
- if exc_type and not req_succeeded :
290
- if "HTTPNotFound" in exc_type .__name__ :
291
- status = "404"
292
- reason = "NotFound"
283
+ if _ENVIRON_EXC in req .env :
284
+ exc = req .env [_ENVIRON_EXC ]
285
+ exc_type = type (exc )
293
286
else :
294
- status = "500"
295
- reason = "{}: {}" .format (exc_type .__name__ , exc )
287
+ exc_type , exc = None , None
288
+ if exc_type and not req_succeeded :
289
+ if "HTTPNotFound" in exc_type .__name__ :
290
+ status = "404"
291
+ reason = "NotFound"
292
+ else :
293
+ status = "500"
294
+ reason = "{}: {}" .format (exc_type .__name__ , exc )
296
295
297
296
status = status .split (" " )[0 ]
298
297
try :
0 commit comments