The exact solution expression is at hand and the numerical solution had been got. Then, how to compute the L2 and H1 errors between them by FeniCS (C++)?
Have a look at how errornorm is implemented.