fix(recorder): Error page rendering shouldn't fail when recorder is active
This commit is contained in:
parent
6a059fc2ac
commit
e54694dbf4
1 changed files with 12 additions and 10 deletions
|
|
@ -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__:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue