mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-06 14:55:07 +01:00
Maybe make CodeQL happy about this exception handling
This commit is contained in:
parent
e2303235cd
commit
dc657f2eb0
1 changed files with 2 additions and 2 deletions
|
|
@ -56,9 +56,9 @@ class MatchingModelSerializer(serializers.ModelSerializer):
|
||||||
):
|
):
|
||||||
try:
|
try:
|
||||||
re.compile(match)
|
re.compile(match)
|
||||||
except Exception as e:
|
except re.error as e:
|
||||||
raise serializers.ValidationError(
|
raise serializers.ValidationError(
|
||||||
_("Invalid regular expression: %(error)s") % {"error": str(e)},
|
_("Invalid regular expression: %(error)s") % {"error": str(e.msg)},
|
||||||
)
|
)
|
||||||
return match
|
return match
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue