Merge change Id1f4cf7b

* changes:
  Clear pending exception before throwing a new one.