// ErrorCode returns status code associated with the error.
ErrorCode returns status code associated with the error.
// ErrorCode returns status code associated with the error .
func ErrorCode(err error) int {
	var serr *statusError
	if !errors.As(err, &serr) {
		return http.StatusInternalServerError
	}
	return serr.code
}
func ErrorCode ( err error ) int { var serr * statusError if ! errors . As ( err , & serr ) { return http . StatusInternalServerError } return serr . code }
ErrorCode returns status code associated with the error.
ErrorCode returns status code associated with the error .