Clear the internal state before raising error. Upstream-commit: f68b8b33e6827c54d86abdd7ef36356453d3703b Component: engine