Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion fire/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,18 @@ def _CallAndUpdateTrace(component, args, component_trace, treatment='class',
# Event loop is already running
component = loop.run_until_complete(fn(*varargs, **kwargs))
else:
component = fn(*varargs, **kwargs)
try:
component = fn(*varargs, **kwargs)
except TypeError as e:
message = str(e)

if 'missing' in message and 'required positional argument' in message:
raise TypeError(
f"Error: {message}\n\n"
f"Hint: Run the command with --help to see usage."
) from None

raise

if treatment == 'class':
action = trace.INSTANTIATED_CLASS
Expand Down