Wrapping error throwing in the process.nextTick for apps to be able to catch the exception.