better error message in scala client