ensure err is an object and emit that

@dannycoates r? Fixes #29