issue #1700 replace raise Exception()