fix(recorder): Error page rendering shouldn't fail when recorder is active

This commit is contained in:
Aditya Hase 2020-10-28 09:36:39 +05:30
parent 6a059fc2ac
commit e54694dbf4
No known key found for this signature in database
GPG key ID: 0A55F0FCA0234972

View file

@ -53,16 +53,18 @@ def sql(*args, **kwargs):
def get_current_stack_frames():
current = inspect.currentframe()
frames = inspect.getouterframes(current, context=10)
for frame, filename, lineno, function, context, index in list(reversed(frames))[:-2]:
if "/apps/" in filename:
yield {
"filename": re.sub(".*/apps/", "", filename),
"lineno": lineno,
"function": function,
}
try:
current = inspect.currentframe()
frames = inspect.getouterframes(current, context=10)
for frame, filename, lineno, function, context, index in list(reversed(frames))[:-2]:
if "/apps/" in filename:
yield {
"filename": re.sub(".*/apps/", "", filename),
"lineno": lineno,
"function": function,
}
except Exception:
pass
def record():
if __debug__: