Define OGRErr as enumerated type
|Reported by:||Mateusz Łoskot||Owned by:||Mateusz Łoskot|
Thanks to strong-typed definition of CPLErr, it is possible to use this type as an exception type in C++ client code. It can be safely thrown and caught as an exception of distinct type. Unfortunately, this technique is not possible with OGRErr because OGRErr is an alias to int.
Perhaps, upcoming 1.7.0 would be a good opportunity to re-define OGRErr. If clients use OGRErr consistently as they should and they don't assign any values that are out of range of OGR error code, nothing should break. IMHO, making OGRErr a strong and unique type would be more beneficial in long term, especially for C++ users.