Convert the adapter error to an actual js error in authenticate