Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
435 views
in Technique[技术] by (71.8m points)

这个conn.run怎么判断是成功,还是失败,或者失败原因呢?

在dolphinDB API中,这个run怎么判断是成功,还是失败,或者失败原因呢?

Entity entity = conn.run(saveFuncName, args);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

DolphinDB API的处理问题的方式是抛出异常,因此需要try catch一下exception,比如:

 try {
    
    Entity entity = conn.run(saveFuncName, args);

 } catch (exception &ex) {
        cout << "Failed to  run  with error: " << ex.what();
        return -1;
 }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...