add raise error and tests
improving exception message