You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Afterwards we could wrap the errors and add additional context for logging:
returnerrors.Wrap(ErrInvalidSource, "all slice elements must implement the jsonapi.MarshalIdentifier interface")
The wrapping approach ensures the clean error interface for applications that have no special interest in the errors. Applications that do want to know the cause of error can use:
Although I really like pkg/errors I am not sure if a library like api2go should force such a framework onto the user, even if its small and helpful. I think we should expose simple standard library errors, as you suggested in your first paragraph, but without the wrapping part.
I agree that standard errors should be used. Additionally, helper methods like os.IsNotExists could be provided. This would make error handling very straightforward.
As only two of many errors are exported, they will be removed with #261 to be concise.
This issue should track the discussion about how errors should be exported again and therefore handled in calling go applications.
From a quick scan I came up with the following classes of errors:
I would suggest that we exports these classes of errors:
Afterwards we could wrap the errors and add additional context for logging:
The wrapping approach ensures the clean
error
interface for applications that have no special interest in the errors. Applications that do want to know the cause of error can use:Some Links to this approach:
The text was updated successfully, but these errors were encountered: