Commit 61fe629
committed
refactor(adms): drop broad except in factories, simplify _BindingData
M1 — ``create_client`` and ``create_async_client`` wrapped any
``Exception`` in ``ClientCreationError``. Because ``load_from_env_or_mount``
already maps real config failures to ``ConfigError`` and explicit
``ValueError`` paths re-raise unchanged, the broad except only ever
caught internal SDK bugs (``KeyError``, ``AttributeError``, ``TypeError``)
and reported them to callers as "client creation failed", masking the
real fault. Drop the catch-all so genuine bugs surface as themselves.
The ``ClientCreationError`` symbol remains exported from
``sap_cloud_sdk.adms.exceptions`` for any caller still catching it, but
the factories no longer raise it. Update the test that asserted the
wrapping behaviour to assert pass-through instead.
M2 — ``_BindingData.validate`` iterated a hard-coded list of field names
via ``getattr(self, f)``. Since the list is static and matches the
dataclass shape, switch to direct attribute access (a list of
``(name, value)`` tuples) — both clearer and friendlier to type checkers.1 parent 7a2ed1d commit 61fe629
3 files changed
Lines changed: 41 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 62 | + | |
67 | 63 | | |
68 | 64 | | |
69 | 65 | | |
| |||
1581 | 1577 | | |
1582 | 1578 | | |
1583 | 1579 | | |
1584 | | - | |
| 1580 | + | |
1585 | 1581 | | |
1586 | | - | |
1587 | | - | |
1588 | | - | |
1589 | | - | |
1590 | | - | |
1591 | | - | |
1592 | | - | |
1593 | | - | |
1594 | | - | |
1595 | | - | |
1596 | | - | |
1597 | | - | |
1598 | | - | |
1599 | | - | |
1600 | | - | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
1601 | 1590 | | |
1602 | 1591 | | |
1603 | 1592 | | |
| |||
1623 | 1612 | | |
1624 | 1613 | | |
1625 | 1614 | | |
1626 | | - | |
| 1615 | + | |
1627 | 1616 | | |
1628 | | - | |
1629 | | - | |
1630 | | - | |
1631 | | - | |
1632 | | - | |
1633 | | - | |
1634 | | - | |
1635 | | - | |
1636 | | - | |
1637 | | - | |
1638 | | - | |
1639 | | - | |
1640 | | - | |
1641 | | - | |
1642 | | - | |
1643 | | - | |
1644 | | - | |
1645 | | - | |
1646 | | - | |
1647 | | - | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
78 | 86 | | |
79 | 87 | | |
80 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
147 | 152 | | |
148 | 153 | | |
149 | 154 | | |
150 | 155 | | |
151 | | - | |
| 156 | + | |
152 | 157 | | |
153 | 158 | | |
154 | 159 | | |
| |||
0 commit comments