Catch js error for pagerun.