// AppErrorConv is a converter from app errors to api errors
AppErrorConv is a converter from app errors to api errors
// AppErrorConv is a converter from app errors to api errors
func AppErrorConv(err error) (res error) {
	switch {
	case errors.Is(err, apperror.ErrNotFound):
		res = errors.Wrapf(ErrNotFound, "%v", err.Error())
	case errors.Is(err, apperror.ErrBadRequest):
		res = errors.Wrapf(ErrBadRequest, "%v", err.Error())
	case errors.Is(err, apperror.ErrInternal):
		res = errors.Wrapf(ErrInternal, "%v", err.Error())
	case errors.Is(err, apperror.ErrDuplicate):
		res = errors.Wrapf(ErrDuplicate, "%v", err.Error())
	case errors.Is(err, apperror.ErrUsersFunc):
		res = errors.Wrapf(ErrUsersFunc, "%v", err.Error())
	case errors.Is(err, apperror.ErrUsersSQL):
		res = errors.Wrapf(ErrUsersSQL, "%v", err.Error())
	case errors.Is(err, apperror.ErrUndefinedTypeOfAction):
		res = errors.Wrapf(ErrUndefinedTypeOfAction, "%v", err.Error())
	case errors.Is(err, apperror.ErrNotInitialised):
		res = errors.Wrapf(ErrNotInitialised, "%v", err.Error())
	default:
		res = err
	}
	return res
}
func AppErrorConv ( err error ) ( res error ) { switch { case errors . Is ( err , apperror . ErrNotFound ) : res = errors . Wrapf ( ErrNotFound , " " , err . Error ( ) ) case errors . Is ( err , apperror . ErrBadRequest ) : res = errors . Wrapf ( ErrBadRequest , " " , err . Error ( ) ) case errors . Is ( err , apperror . ErrInternal ) : res = errors . Wrapf ( ErrInternal , " " , err . Error ( ) ) case errors . Is ( err , apperror . ErrDuplicate ) : res = errors . Wrapf ( ErrDuplicate , " " , err . Error ( ) ) case errors . Is ( err , apperror . ErrUsersFunc ) : res = errors . Wrapf ( ErrUsersFunc , " " , err . Error ( ) ) case errors . Is ( err , apperror . ErrUsersSQL ) : res = errors . Wrapf ( ErrUsersSQL , " " , err . Error ( ) ) case errors . Is ( err , apperror . ErrUndefinedTypeOfAction ) : res = errors . Wrapf ( ErrUndefinedTypeOfAction , " " , err . Error ( ) ) case errors . Is ( err , apperror . ErrNotInitialised ) : res = errors . Wrapf ( ErrNotInitialised , " " , err . Error ( ) ) default : res = err } return res }
AppErrorConv is a converter from app errors to api errors
AppErrorConv is a converter from app errors to api errors