Commit 31c851f
committed
Address gitar-bot review: let ValueError propagate from clean_host_port
The broad 'except Exception' in model_post_init() was swallowing the
intentional ValueError that clean_host_port raises for invalid ports
(e.g. 'http://localhost:abc'), leaving a malformed hostPort on the
connection object and turning a clear user error into an obscure
downstream failure.
The local import of clean_host_port is from a sibling module that
always exists, so the try/except was unnecessary defence. Removed it
so pydantic surfaces validation errors where they belong.1 parent 4418065 commit 31c851f
1 file changed
Lines changed: 6 additions & 9 deletions
Lines changed: 6 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
67 | 64 | | |
68 | 65 | | |
69 | 66 | | |
| |||
0 commit comments