  A real valued function $f$ defined on a real open interval $I$ is called
$\Phi$-convex if, for all $x,y\in I$, $t\in[0,1]$ it satisfies $$
  f(tx+(1-t)y)\leq
tf(x)+(1-t)f(y)+t\Phi\big((1-t)|x-y|\big)+(1-t)\Phi\big(t|x-y|\big), $$ where
$\Phi:\mathbb{R}_+\to\mathbb{R}_+$ is a nonnegative error function. If $f$ and
$-f$ are simultaneously $\Phi$-convex, then $f$ is said to be a $\Phi$-affine
function. In the main results of the paper, we describe the structural and
inclusion properties of these two classes. We characterize these two classes of
functions and investigate their relationship with approximately monotone and
approximately-H\"older functions. We also introduce a subclass of error
functions which enjoy the so-called $\Gamma$ property and we show that the
error function which is the most optimal for a $\Phi$-convex function has to
belong to this subclass. The properties of this subclass of error function are
investigated as well. Then we offer two formulas for the lower $\Phi$-convex
envelop. Besides, a sandwich type theorem is also added.
