I have added an internal error handling interface which can be used for debugging internal interfaces and implementations. Since it implements Go's error interface, it can be used by the external interfaces for basic error checking (if err == nil everything is good) and error messages.
Right now, the error structure SpaceError is defined for Space structures, but could in principle be generalised to more structures if one is careful. That way many different error types for different abstractions could be avoided.
The error handling uses reflect and runtime packages, so it is interesting to know if performance is still acceptable when these are used, or something different should be done.
No further ways of inspecting the error structure has been added, as this should be defined carefully, with the developer in mind, and of course following Go principles.
See commit 9b567911abfa97a423b87e4e254e0f3753e7ca12 for further details.
If any body has feedback to this or want to see improvements to the error types, please do tell.
I have added an internal error handling interface which can be used for debugging internal interfaces and implementations. Since it implements Go's
error
interface, it can be used by the external interfaces for basic error checking (if err == nil
everything is good) and error messages.Right now, the error structure
SpaceError
is defined forSpace
structures, but could in principle be generalised to more structures if one is careful. That way many different error types for different abstractions could be avoided.The error handling uses
reflect
andruntime
packages, so it is interesting to know if performance is still acceptable when these are used, or something different should be done.No further ways of inspecting the error structure has been added, as this should be defined carefully, with the developer in mind, and of course following Go principles.
See commit 9b567911abfa97a423b87e4e254e0f3753e7ca12 for further details.
If any body has feedback to this or want to see improvements to the error types, please do tell.