Error in Magnetometer Readings
Your equation ( \$e_m = \sqrt{e_x^2 + e_y^2 + e_z^2} \$) is the absolute error in the magnitude (so divide by the magnitude to get the % error). 

It's going to be a bit messier working out the angular error in heading.