LPS-41701 Make sure appropriate exception is thrown