falconry / falcon

The no-magic web data plane API and microservices framework for Python developers, with a focus on reliability, correctness, and performance at scale.
https://falcon.readthedocs.io/en/stable/
Apache License 2.0
9.53k stars 945 forks source link

Unclear which `HTTPError` was instantiated from `deprecated_args()` warnings #2010

Closed vytas7 closed 2 years ago

vytas7 commented 2 years ago

In Falcon 3.0.x, instantiating HTTPError or its subclasses with positional arguments (of course except the allowed ones) generates a DeprecatedWarning via the deprecated_args() decorator.

However, it is unclear from the warning which class/function was invoked, it just says "calls [with more than N] positional args are deprecated". Brought up by @laurent-chriqui (see the linked PR).

Ideally, as a developer, I would like the warning to read along the lines of

DeprecatedWarning: Calls to HTTPNotFound.__init__(...) with positional args are deprecated. Please specify them as keyword arguments instead.