Better error message in case there is an exception in the underlying JS query