Skip to content

Commit

Permalink
Merge pull request #412 from bambookchos/bugfix/wrap-mask-credential-…
Browse files Browse the repository at this point in the history
…in-try-except

Wrap re.sub() in try-except
  • Loading branch information
Asif Saif Uddin authored Apr 4, 2020
2 parents badf852 + be18eab commit 477e5e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion silk/model_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ def replace_pattern_values(obj):
Logger.debug('{}'.format(str(e)))
else:
for res in results:
body = re.sub(res[1], RequestModelFactory.CLEANSED_SUBSTITUTE, body)
try:
body = re.sub(res[1], RequestModelFactory.CLEANSED_SUBSTITUTE, body)
except Exception:
Logger.debug('{}'.format(str(e)))
else:
body = json.dumps(replace_pattern_values(json_body))

Expand Down

0 comments on commit 477e5e6

Please sign in to comment.