Always construct new exception on error, otherwise memory leak may occur due to repeated use of singleton exception. Closes gh-28550
Always construct new exception on error, otherwise memory leak may occur due to repeated use of singleton exception. Closes gh-28550