Should only call `console.error()` if err is non-zero.