This is class is used throughout the library to communicate errors that can occur during the performance of various operations.
More...
This is class is used throughout the library to communicate errors that can occur during the performance of various operations.
I'm not a fan of exception-throwing, which some may consider a more modern approach. It is a bit combersome to pass an Error class reference all over the place, but it's a convention that I've found works reasonably well, and makes me feel better about the software cleaning up after itself whether an error occurs or not. One advantage to not throwing exceptions is that the caller doesn't have to try (and often fail) to catch exceptions (due to not knowing which to catch or just not trying). Rather, the caller just needs to be in the habit of always checking the return value. They can choose to ignore the return value, but it's always there for them to be able to check if they want.