Skip to content

Commit

Permalink
Redact CredOption during exception
Browse files Browse the repository at this point in the history
  • Loading branch information
laggykiller committed Feb 6, 2024
1 parent d05b724 commit 355df39
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/sticker_convert/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,15 @@ def worker(
results = work_func(*work_args, cb_queue, cb_return) # type: ignore
results_queue.put(results)
except Exception:
arg_dump: list[Any] = []
for i in work_args:
if isinstance(i, CredOption):
arg_dump.append("CredOption(REDACTED)")
else:
arg_dump.append(i)
e = "##### EXCEPTION #####\n"
e += "Function: " + repr(work_func) + "\n"
e += "Arguments: " + repr(work_args) + "\n"
e += "Arguments: " + repr(arg_dump) + "\n"
e += traceback.format_exc()
e += "#####################"
cb_queue.put(e)
Expand Down

0 comments on commit 355df39

Please sign in to comment.