Skip to content

Commit d8b7c5c

Browse files
committed
fix: avoid bare exception catching
1 parent c8df080 commit d8b7c5c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scim2_models/reference.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from pydantic import GetCoreSchemaHandler
1010
from pydantic_core import Url
11+
from pydantic_core import ValidationError
1112
from pydantic_core import core_schema
1213

1314
from .utils import UNION_TYPES
@@ -166,5 +167,5 @@ def _validate_uri(value: str) -> None:
166167
return
167168
try:
168169
Url(value)
169-
except Exception as e:
170+
except ValidationError as e:
170171
raise ValueError(f"Invalid URI: {value}") from e

0 commit comments

Comments
 (0)