Wouldn't it be good to wrap this in a conditional?

```js
if (error.stack) {
  console.error(error.stack);
}
```