apache / dubbo-go-hessian2

caucho hessian2 implementation in Go for [apache/dubbo-go](https://github.com/apache/dubbo-go) which is compatible with [dubbo-hessian-lite](https://github.com/apache/dubbo-hessian-lite)
Apache License 2.0
209 stars 113 forks source link

Imp: hessian2 should handle all errors of encode and decode #51

Closed u0x01 closed 4 years ago

u0x01 commented 5 years ago

What would you like to be added: improve hessian2 error handling

Why is this needed: If you don't handle these errors, it will cause errors to appear in the upper application, will occur some unforeseen, weird problems. Which is hard to trace reason.

eg: https://github.com/dubbogo/hessian2/blob/c432dcada9eab283abc851c7f65760f18a0377c6/request.go#L172 https://github.com/dubbogo/hessian2/blob/c432dcada9eab283abc851c7f65760f18a0377c6/request.go#L173 https://github.com/dubbogo/hessian2/blob/c432dcada9eab283abc851c7f65760f18a0377c6/request.go#L174 https://github.com/dubbogo/hessian2/blob/c432dcada9eab283abc851c7f65760f18a0377c6/request.go#L175

wongoo commented 5 years ago

@u0x01 yes, all errors should be handled, but a return error should be ignored by assigned to underline if it won't really happen. The errors in the examples you shown can be all ignored. have u already meet some errors which can't be traced? can u provide a test case? And a pr is also welcome too.

wongoo commented 5 years ago

@u0x01 if there is not problem, we will close it. @AlexStocks