throw exceptions where required