Skip to content
Snippets Groups Projects
Commit d940fc70 authored by Marcel Loose's avatar Marcel Loose :sunglasses:
Browse files

Bug 1626: Fixed handling of result codes

parent 7ccef1ef
No related branches found
No related tags found
No related merge requests found
......@@ -97,25 +97,18 @@ GCFEvent::TResult ControllerProtMenu::initial_state(GCFEvent& event, GCFPortInte
}
break;
case CONTROL_CONNECTED: {
CONTROLConnectedEvent msg(event);
cout << endl << "Connection result = " << msg.result << endl;
if (msg.result != CT_RESULT_NO_ERROR) {
cout << "Bailing out because of the errors." << endl;
GCFScheduler::instance()->stop ();
}
else {
case CONTROL_CONNECT: {
CONTROLConnectEvent msg(event);
itsControllerName = msg.cntlrName;
cout << endl << "Name of the controller is " << itsControllerName << endl;
_doActionMenu(); // does a TRAN
}
}
break;
case CONTROL_QUITED: {
CONTROLQuitedEvent msg(event);
cout << endl << "Connection failed with result = " << msg.result << endl;
if (msg.result != CT_RESULT_NO_ERROR) {
if (msg.result != CONTROL_OK_ERR) {
cout << "Bailing out because of the errors." << endl;
GCFScheduler::instance()->stop ();
}
......@@ -157,7 +150,7 @@ GCFEvent::TResult ControllerProtMenu::claim_state(GCFEvent& event, GCFPortInterf
case CONTROL_CLAIMED: {
CONTROLClaimedEvent msg(event);
cout << endl << "Claim result = " << msg.result << endl;
if (msg.result != CT_RESULT_NO_ERROR) {
if (msg.result != CONTROL_OK_ERR) {
cout << "Bailing out because of the errors." << endl;
GCFScheduler::instance()->stop ();
}
......@@ -203,7 +196,7 @@ GCFEvent::TResult ControllerProtMenu::prepare_state(GCFEvent& event, GCFPortInte
case CONTROL_PREPARED: {
CONTROLPreparedEvent msg(event);
cout << endl << "Prepare result = " << msg.result << endl;
if (msg.result != CT_RESULT_NO_ERROR) {
if (msg.result != CONTROL_OK_ERR) {
cout << "Bailing out because of the errors." << endl;
GCFScheduler::instance()->stop ();
}
......@@ -248,7 +241,7 @@ GCFEvent::TResult ControllerProtMenu::run_state(GCFEvent& event, GCFPortInterfac
case CONTROL_RESUMED: {
CONTROLResumedEvent msg(event);
cout << endl << "Resume result = " << msg.result << endl;
if (msg.result != CT_RESULT_NO_ERROR) {
if (msg.result != CONTROL_OK_ERR) {
cout << "Bailing out because of the errors." << endl;
GCFScheduler::instance()->stop ();
}
......@@ -293,7 +286,7 @@ GCFEvent::TResult ControllerProtMenu::suspend_state(GCFEvent& event, GCFPortInte
case CONTROL_SUSPENDED: {
CONTROLSuspendedEvent msg(event);
cout << endl << "Suspend result = " << msg.result << endl;
if (msg.result != CT_RESULT_NO_ERROR) {
if (msg.result != CONTROL_OK_ERR) {
cout << "Bailing out because of the errors." << endl;
GCFScheduler::instance()->stop ();
}
......@@ -338,7 +331,7 @@ GCFEvent::TResult ControllerProtMenu::release_state(GCFEvent& event, GCFPortInte
case CONTROL_RELEASED: {
CONTROLReleasedEvent msg(event);
cout << endl << "Release result = " << msg.result << endl;
if (msg.result != CT_RESULT_NO_ERROR) {
if (msg.result != CONTROL_OK_ERR) {
cout << "Bailing out because of the errors." << endl;
GCFScheduler::instance()->stop ();
}
......@@ -382,7 +375,7 @@ GCFEvent::TResult ControllerProtMenu::finish_state(GCFEvent& event, GCFPortInter
case CONTROL_QUITED: {
CONTROLQuitedEvent msg(event);
if (msg.result != CT_RESULT_NO_ERROR) {
if (msg.result != CONTROL_OK_ERR) {
cout << endl << "WARNING: Finish result = " << msg.result << endl;
}
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment