dss-extensions / dss_sharp

C#/.NET bindings for DSS C-API, an unofficial implementation of OpenDSS with a custom API in plain C, new features and API extensions.
https://dss-extensions.org/dss_sharp/
BSD 3-Clause "New" or "Revised" License
8 stars 0 forks source link

Make exceptions optional #15

Closed PMeira closed 1 year ago

PMeira commented 2 years ago

Although we always recommend using exceptions (e.g. stop early on any errors) for any of the projects under DSS Extensions, old code based on the official COM module may already be checking DSS.Error.Number manually.

To allow easier migration on that context, especially for users required to toggle between implementations, adding a static field to toggle the exceptions and allow the users to follow the original codepath seems ideal, and it's almost trivial to implement on our side.