std-http-strict: Request body unmarshal errors should be wrapped by the package errors
Currently, there is no easy way to know if an error is a request body deserialization.
Please create a custom error type for wrapping these errors so we can use errors.Is in custom error handling.
I volunteer myself towards implementing it if necessary.
Would you mind confirming if this behaviour is available any of the other server implementations we have?
Every server deserialize the body their own way. Chi uses context Bind Fiber uses BodyParser and so on...
What you would need to do is create an InvalidBody and MissingBody errors that wraps the underlying provided error from each framework.
Currently you wrap it using fmt.Errorf, the problem is that the json package returns tons of different error types.
And you also use json in other parts like Cookies.
For the developer to be able to know if the error was a body error, you need to wrap them