[R] fix error handling in the R client #22704
+204
−95
Merged
Loading