lorenzodonini / ocpp-go

Open Charge Point Protocol implementation in Go
MIT License
262 stars 125 forks source link

Custom error structs in websocket package #47

Open lorenzodonini opened 3 years ago

lorenzodonini commented 3 years ago

Follow-up to #40

Errors sent over the errC channels in WsServer and WsClient are currently basic errors.

In some cases errors should be structs, containing some additional info, such as:

Any struct will still be sent as an error, therefore not breaking the API. Channel consumers, however, may optionally perform type assertion and access the additional info.