added tests for errors, and fixed generator throw errors. closes #5