A refractive phase corrector optics is proposed for the compensation of fabrication error of X-ray optical elements. Here, at-wavelength wavefront measurements of the focused X-ray beam by knife-edge imaging technique, the design of a three-dimensional corrector plate, its fabrication by 3D printing, and use of a corrector to compensate for X-ray lens figure errors are presented. A rotationally invariant corrector was manufactured in the polymer IP-STM using additive manufacturing based on the two-photon polymerization technique. The fabricated corrector was characterized at the B16 Test beamline, Diamond Light Source, UK, showing a reduction in r.m.s. wavefront error of a Be compound refractive Lens (CRL) by a factor of six. The r.m.s. wavefront error is a figure of merit for the wavefront quality but, for X-ray lenses, with significant X-ray absorption, a form of the r.m.s. error with weighting proportional to the transmitted X-ray intensity has been proposed. The knife-edge imaging wavefront-sensing technique was adapted to measure rotationally variant wavefront errors from two different sets of Be CRL consisting of 98 and 24 lenses. The optical aberrations were then quantified using a Zernike polynomial expansion of the 2D wavefront error. The compensation by a rotationally invariant corrector plate was partial as the Be CRL wavefront error distribution was found to vary with polar angle indicating the presence of non-spherical aberration terms. A wavefront correction plate with rotationally anisotropic thickness is proposed to compensate for anisotropy in order to achieve good focusing by CRLs at beamlines operating at diffraction-limited storage rings.