- make error messages more informative
This commit is contained in:
@@ -3235,7 +3235,7 @@ static int SetSICSHdbProperty(SConnection * pCon, SicsInterp * pSics,
|
|||||||
}
|
}
|
||||||
targetNode = FindHdbNode(NULL, argv[1], pCon);
|
targetNode = FindHdbNode(NULL, argv[1], pCon);
|
||||||
if (targetNode == NULL) {
|
if (targetNode == NULL) {
|
||||||
SCWrite(pCon, "ERROR: node not found", eError);
|
SCPrintf(pCon, eError, "ERROR: node %s not found", argv[1]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
val = Arg2Tcl(argc - 3, &argv[3], buffer, sizeof buffer);
|
val = Arg2Tcl(argc - 3, &argv[3], buffer, sizeof buffer);
|
||||||
@@ -3255,12 +3255,12 @@ static int DelSICSHdbProperty(SConnection * pCon, SicsInterp * pSics,
|
|||||||
pHdb targetNode = NULL;
|
pHdb targetNode = NULL;
|
||||||
|
|
||||||
if (argc < 3) {
|
if (argc < 3) {
|
||||||
SCWrite(pCon, "ERROR: need path key as parameters", eError);
|
SCWrite(pCon, "ERROR: need path and key as parameters", eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
targetNode = FindHdbNode(NULL, argv[1], pCon);
|
targetNode = FindHdbNode(NULL, argv[1], pCon);
|
||||||
if (targetNode == NULL) {
|
if (targetNode == NULL) {
|
||||||
SCWrite(pCon, "ERROR: node not found", eError);
|
SCPrintf(pCon, eError, "ERROR: node %s not found", argv[1]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
SetHdbProperty(targetNode, argv[2], NULL);
|
SetHdbProperty(targetNode, argv[2], NULL);
|
||||||
@@ -3277,12 +3277,12 @@ static int GetSICSHdbProperty(SConnection * pCon, SicsInterp * pSics,
|
|||||||
int status;
|
int status;
|
||||||
|
|
||||||
if (argc < 3) {
|
if (argc < 3) {
|
||||||
SCWrite(pCon, "ERROR: need path key as parameters", eError);
|
SCWrite(pCon, "ERROR: need path and key as parameters", eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
targetNode = FindHdbNode(NULL, argv[1], pCon);
|
targetNode = FindHdbNode(NULL, argv[1], pCon);
|
||||||
if (targetNode == NULL) {
|
if (targetNode == NULL) {
|
||||||
SCWrite(pCon, "ERROR: node not found", eValue);
|
SCPrintf(pCon, eError, "ERROR: node %s not found", argv[1]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
status = GetHdbProperty(targetNode, argv[2], buffer, 511);
|
status = GetHdbProperty(targetNode, argv[2], buffer, 511);
|
||||||
@@ -3303,12 +3303,12 @@ static int GetSICSHdbPropertyVal(SConnection * pCon, SicsInterp * pSics,
|
|||||||
int status;
|
int status;
|
||||||
|
|
||||||
if (argc < 3) {
|
if (argc < 3) {
|
||||||
SCWrite(pCon, "ERROR: need path key as parameters", eError);
|
SCWrite(pCon, "ERROR: need path and key as parameters", eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
targetNode = FindHdbNode(NULL, argv[1], pCon);
|
targetNode = FindHdbNode(NULL, argv[1], pCon);
|
||||||
if (targetNode == NULL) {
|
if (targetNode == NULL) {
|
||||||
SCWrite(pCon, "ERROR: node not found", eError);
|
SCPrintf(pCon, eError, "ERROR: node %s not found", argv[1]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
status = GetHdbProperty(targetNode, argv[2], buffer, 511);
|
status = GetHdbProperty(targetNode, argv[2], buffer, 511);
|
||||||
@@ -3335,7 +3335,7 @@ static int ListSICSHdbProperty(SConnection * pCon, SicsInterp * pSics,
|
|||||||
}
|
}
|
||||||
targetNode = FindHdbNode(NULL, argv[1], pCon);
|
targetNode = FindHdbNode(NULL, argv[1], pCon);
|
||||||
if (targetNode == NULL) {
|
if (targetNode == NULL) {
|
||||||
SCWrite(pCon, "ERROR: node not found", eError);
|
SCPrintf(pCon, eError, "ERROR: node %s not found", argv[1]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
data = CreateDynString(64, 64);
|
data = CreateDynString(64, 64);
|
||||||
|
|||||||
Reference in New Issue
Block a user