-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(wait_for_task_loaded): modify return condition - even if 'return_…
…on_error' is true, when receiving the error message (load nofile), the function returns error
- Loading branch information
1 parent
d7e1cbf
commit 80028b5
Showing
2 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include <iostream> | ||
#include "rbpodo/rbpodo.hpp" | ||
|
||
using namespace std; | ||
using namespace rb::podo; | ||
|
||
int main() { | ||
try { | ||
auto robot = Cobot("10.0.2.7"); | ||
auto rc = ResponseCollector(); | ||
|
||
robot.task_load(rc, "default"); | ||
if(robot.wait_for_task_loaded(rc).type() == ReturnType::Success) { | ||
std::cout << "'default' wsl exists" << std::endl; | ||
} else { | ||
std::cerr << "Error" << std::endl; | ||
} | ||
rc = rc.error().throw_if_not_empty(); | ||
|
||
robot.task_load(rc, "default_does_not_exist"); | ||
if(robot.wait_for_task_loaded(rc).type() == ReturnType::Error) { | ||
std::cout << "'default_dose_not_exist' wsl does not exist" << std::endl; | ||
} | ||
rc = rc.error().throw_if_not_empty(); | ||
} catch (const std::exception& e) { | ||
std::cerr << e.what() << std::endl; | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters