TritonDataCenter / node-verror

Rich JavaScript errors
MIT License
1.18k stars 61 forks source link

1.7 breaking change `we_cause` -> `jse_cause` #37

Closed awolden closed 8 years ago

awolden commented 8 years ago

A build error was introduced to one of our projects and I tracked it down to this library (via restify-errors). When receiving an error object back, we were expecting there to be a property called we_cause, but it seems that has been mapped to jse_cause in the most recent release .

This is an easily fixed issue on our end, but I wanted to raise awareness about this potentially breaking change.

Thanks!

davepacheco commented 8 years ago

Thanks for the heads-up, and sorry for the impact. That field was always supposed to be private. The .cause() method (or, better, the new VError.cause() function) is the expected way to get at that.

davepacheco commented 8 years ago

I'm not planning to change this, since restify-errors was depending on a private field. I'd still like to hear if it's breaking other packages, though.

DonutEspresso commented 8 years ago

@awolden restify-errors only uses the internal fields for unit tests (which are indeed currently broken). However, the code itself should not be accessing these fields directly. If you're seeing a problem with restify-errors, please file an issue in our repo. Thanks!

awolden commented 8 years ago

@donutespresso Thanks for the response! The issue wasn't with restify-errors per-se, our tests were broken cause we were using the same internal properties that probably broke your tests. Based on Dave's comment above we changed our code to use .cause() and it's working great.

We love restify-errors, so if we see an issue we will definitely provide feedback!