Skip to content

Fix order of events #32

Open
Open
@rudpot

Description

Executing the lambda handler in all cases and only over-writing the error code if a valid parameter result is received means that the function code will be invoked and will falsely report an error instead of not being invoked and reporting a fake error.

if _fault_type == "status_code":
result = func(*args, **kwargs)
if isinstance(_chaos_conf.get("error_code"), int):
_error_code = _chaos_conf.get("error_code")

The simple solution would be to fix the order of operations. The structurally better solution would be to rebuild the whole library with a hooks pattern where the customer could define a list of faults/frequencies to inject before and after function execution.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions