vartanbeno / go-reddit

Go library for accessing the Reddit API.
Other
306 stars 84 forks source link

Error Type Vagueness #16

Open RGood opened 3 years ago

RGood commented 3 years ago

Currently go-reddit uses the default error type in Go, which is just an interface with a string attribute. It would be helpful to create a custom error type that included more specific information such as response code or the specific ENUM error type.

vartanbeno commented 3 years ago

Hello! Thank you for opening this issue. Can you please provide an example? Some of the error types (here) contain an *http.Response instance which can be inspected if an error is returned.

RGood commented 3 years ago

The example / use-case I'm thinking of pertains to the client.Message.Send method, which just returns a generic error object, as far as I can tell