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
8 changes: 8 additions & 0 deletions fire/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ def _Fire(component, args, parsed_flag_args, context, name=None):

instance = None
remaining_args = args
ExceptionRaisedByUser = None
while True:
last_component = component
initial_args = remaining_args
Expand Down Expand Up @@ -546,6 +547,11 @@ def _Fire(component, args, parsed_flag_args, context, name=None):
component_trace.AddAccessedProperty(
component, target, consumed_args, filename, lineno)

if candidate_errors:
error, initial_args = candidate_errors[0]
component_trace.AddError(error, initial_args)
ExceptionRaisedByUser = component_trace

except FireError as error:
# Couldn't access member.
candidate_errors.append((error, initial_args))
Expand All @@ -563,6 +569,8 @@ def _Fire(component, args, parsed_flag_args, context, name=None):
candidate_errors.append((error, initial_args))

if not handled and candidate_errors:
if ExceptionRaisedByUser:
return ExceptionRaisedByUser
error, initial_args = candidate_errors[0]
component_trace.AddError(error, initial_args)
return component_trace
Expand Down