lorenzodonini / ocpp-go

Open Charge Point Protocol implementation in Go
MIT License
277 stars 126 forks source link

resolves issues/173 checking and handling invalid message property for CALL_ERROR in ParseMessage #186

Closed sc-atompower closed 1 year ago

sc-atompower commented 1 year ago

https://github.com/lorenzodonini/ocpp-go/issues/173

Currently in the (Endpoint).ParseMessage() fun there are several type cast checks in place. However for CALL_ERROR message types there is no type case check for error code thus allowing for a runtime panic. This pull request resolve this issue and returns a conventional error message.

lorenzodonini commented 1 year ago

@sc-atompower Thanks for submitting this and also for writing a test! Nice fix.