go-reddit icon indicating copy to clipboard operation
go-reddit copied to clipboard

Error Type Vagueness

Open RGood opened this issue 3 years ago • 2 comments

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.

RGood avatar Apr 18 '21 18:04 RGood

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.

vartanbeno avatar Apr 22 '21 01:04 vartanbeno

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

RGood avatar Apr 22 '21 21:04 RGood