Better Error Handling in Example

Moved from `console.error(err)` to `console.error(err.stack)` which will produce output more inline with what one would expect in this scenario (a full stack trace).