You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e697a4b
Browse filesBrowse the repository at this point in the historyBrowse files
fix(const): keep AppType/OptionType.register loud inside a quiet block (#1916) (#1927)
* fix(const): keep AppType/OptionType.register loud inside a quiet block (#1916)
- AppType.register and OptionType.register called _validate_value bare, so a
rejection raised inside an enclosing quiet get block logged nothing. Run it
inside `with _CaughtByCaller():`, as EnumRegistry.register does (#1845), in
the vendor templates, and import _CaughtByCaller there.
- Regenerate pcapkit/const/reg/apptype/apptype.py and
pcapkit/const/pcapng/option_type.py from the edited templates, reusing the
committed crawled data rather than re-crawling.
- Add a unit test that TCP.register(70000, 'x') and OptionType.register(-1,
'x') still leave their record on the pcapkit logger inside
`_CaughtByCaller(ValueError)`.
Closes#1916
* refactor(utilities): rename _CaughtByCaller to CaughtByCaller (#1916)
- The block is used across pcapkit as a library-wide context manager, so
drop the leading underscore. It is new in this beta, so no old-name
re-export is kept.
- Rename every use: exceptions.py, corekit/enum.py, the AppType and
OptionType vendor templates, the exceptions docs page, and the tests that
open the block. The two const modules are regenerated from the templates.
- Export it from pcapkit.utilities.exceptions.__all__ and word its docstring
as a contract, with a versionadded directive.
Refs #1916
0 commit comments