layeh / radius

a Go (golang) RADIUS client and server implementation
https://pkg.go.dev/layeh.com/radius
Mozilla Public License 2.0
567 stars 176 forks source link

Distinguish connection or server error during client.Exchange() #104

Open ilkondr opened 2 years ago

ilkondr commented 2 years ago

Hi there!

Is there a way to check error type to distinguish connection/server error from packet encoding error? I need to walk thru the list of Radius servers and now it's not clear if I need to try next server or stop.

Thanks

ghost commented 2 years ago

There is not a great solution for this right now. Ideally, each type of error that this library would return would have its own specific error type that could be used in conjunction with errors.Is.