mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-09 09:58:20 -05:00
Maybe make CodeQL happy about this exception handling
This commit is contained in:
parent
e2303235cd
commit
dc657f2eb0
@ -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…
x
Reference in New Issue
Block a user