error vs. residual
The error (or disturbance) of an observed value
is the deviation of the observed value from the (unobservable) true value of a quantity of interest (for example, a population mean)
The residual of an observed value
is the difference between the observed value and the estimated value of the quantity of interest (for example, a sample mean).