ensure err is an object and emit that
Merge pull request #30 from jrgm/issue29

ensure err is an object and emit that