emit error events. closes #30

All tests pass.