Execute an action if this expected is an error.
expected, unchanged
Function handling the case when error is present.