| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
When a function call raises TypeError due to missing or unexpected arguments, convert it to FireError so it flows through Fire's error display pipeline (error message + usage text) instead of crashing with a raw Python traceback. The existing _ParseArgs validation catches most missing-argument cases, but edge cases (e.g. *args unpacking mismatches, argument type conflicts) can slip through to the actual fn() call. Only argument-related TypeErrors are caught — other TypeErrors (e.g. from the function body itself) are re-raised unchanged. Fixes google#633
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #633
Description
When a function call raises TypeError due to missing or unexpected arguments, the exception now gets converted to FireError so it flows through Fire's error display pipeline (error message + usage text) instead of crashing with a raw Python traceback.
The existing _ParseArgs validation catches most missing-argument cases before the function is called. But edge cases — like *args unpacking mismatches, keyword argument conflicts, or arguments that Fire's parser couldn't map — can slip through to the actual fn(*varargs, **kwargs) call in _CallAndUpdateTrace.
What changed
Wrapped the function call block (lines 679-690) in _CallAndUpdateTrace with a try/except that:
Testing