func GetValidationError(err error) error {
	// Check if the error is type of validation
	if vErr, ok := err.(RequestValidationError); ok {
		if causeErr, ok := vErr.Cause().(RequestValidationError); ok {
			return ValidationError{
				field:  util.CamelToSnake(causeErr.Field()),
				reason: causeErr.Reason(),
				key:    causeErr.Key(),
				cause:  causeErr.Cause(),
			}
		}
	}
	return err
}
// GetValidationError function returns a validation error from an error.
GetValidationError function returns a validation error from an error.
// GetValidationError function returns a validation error from an error .
func GetValidationError(err error) error {
	if vErr, ok := err.(RequestValidationError); ok {
		if causeErr, ok := vErr.Cause().(RequestValidationError); ok {
			return ValidationError{
				field:  util.CamelToSnake(causeErr.Field()),
				reason: causeErr.Reason(),
				key:    causeErr.Key(),
				cause:  causeErr.Cause(),
			}
		}
	}
	return err
}
func GetValidationError ( err error ) error { if vErr , ok := err . ( RequestValidationError ) ; ok { if causeErr , ok := vErr . Cause ( ) . ( RequestValidationError ) ; ok { return ValidationError { field : util . CamelToSnake ( causeErr . Field ( ) ) , reason : causeErr . Reason ( ) , key : causeErr . Key ( ) , cause : causeErr . Cause ( ) , } } } return err }
GetValidationError function returns a validation error from an error.
GetValidationError function returns a validation error from an error .
// Check if the error is type of validation