Handle error that is emitted from process.nextTick