Problem:
i have made an effort to throw exceptions where appropriate, however I keep using stl types and conveying library specific information via the what string. This ties exception handling to string parsing and presentation to the english language.
Thoughts:
Need to come up with an exception type policy. This project should provide nonstandard exception types (to differentiate exceptions thrown by this lib vs others), and those types should convey useful information. One type is useful, because it allows users to differentiate exceptions thrown by this lib vs any other lib. A single type with specifics about the throw in the what string does not get away from the problem of presentation vs cause.
Possible solution:
A single exception type that contains a lib defined enum member could be the best solution. this would provide a lib specific type, so users could specify a catch block that only listens to exceptions thrown from this library, and the lib provided enum would be a mechanism to further decorate the exception (out of bounds, out of memory, invalid vertex format, ...) in a language agnostic way and without the number of exception types exploding to something unmanagable
Problem: i have made an effort to throw exceptions where appropriate, however I keep using stl types and conveying library specific information via the what string. This ties exception handling to string parsing and presentation to the english language.
Thoughts: Need to come up with an exception type policy. This project should provide nonstandard exception types (to differentiate exceptions thrown by this lib vs others), and those types should convey useful information. One type is useful, because it allows users to differentiate exceptions thrown by this lib vs any other lib. A single type with specifics about the throw in the what string does not get away from the problem of presentation vs cause.
Possible solution: A single exception type that contains a lib defined enum member could be the best solution. this would provide a lib specific type, so users could specify a catch block that only listens to exceptions thrown from this library, and the lib provided enum would be a mechanism to further decorate the exception (out of bounds, out of memory, invalid vertex format, ...) in a language agnostic way and without the number of exception types exploding to something unmanagable