Add more error handling for rantrg get

Signed-off-by: Zhao Xianghu <zhaoxh@ihep.ac.cn>