Skip to content

Commit 29f4117

Browse files
committed
reset self.response and lint
1 parent f5e80a8 commit 29f4117

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

datadog_lambda/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ class XrayDaemon(object):
5151
"503": "503 Service Unavailable",
5252
"504": "504 Gateway Timeout",
5353
"505": "505 HTTP Version Not Supported",
54-
}
54+
}

datadog_lambda/wrapper.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ def __call__(self, event, context, **kwargs):
153153
self._after(event, context)
154154

155155
def _before(self, event, context):
156+
self.response = None
156157
try:
157158

158159
set_cold_start()
@@ -198,11 +199,14 @@ def _after(self, event, context):
198199
if self.span:
199200
self.span.set_traceback()
200201
self.span.error = 1
201-
self.span.set_tags({
202-
ERROR_TYPE: "5xx Server Errors",
203-
ERROR_MSG: SERVER_ERRORS_STATUS_CODES.get(status_code,
204-
"5xx Server Errors"),
205-
})
202+
self.span.set_tags(
203+
{
204+
ERROR_TYPE: "5xx Server Errors",
205+
ERROR_MSG: SERVER_ERRORS_STATUS_CODES.get(
206+
status_code,
207+
"5xx Server Errors"),
208+
}
209+
)
206210
# Create a new dummy Datadog subsegment for function trigger tags so we
207211
# can attach them to X-Ray spans when hybrid tracing is used
208212
if self.trigger_tags:

0 commit comments

Comments
 (0)