Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
themeConfluence
EdmiError edmiRemoteGetErrorText(SdaiServerContext serverContextId,
                                   EdmiError         errCode, 
                                   SdaiString        *errorText, 
                                   SdaiInvocationId  *edmiInvocationId);
 

Returns the error message that corresponds to the

...

given  EDMinterface  error code.

...

Note that the returned message is located in a static buffer in EDMinterface

...

and may be overwritten by the next EDMinterface

...

operation.

...

Arguments

...

TypeNameComment
SdaiServerContext

serverContextId

Context identification, from edmiDefineServerContext

EdmiError

errCode

The _The  EDMinterface_   error code.

SdaiString

errorText

A variable tat will receive the error message that corresponds to the given _given  EDMinterface_   error code. Do not use edmiFree edmFree to release this memory.

SdaiInvocationId

edmiInvocationId

Currently not used.

...

Return Value

...

Insert excerpt
US:_r_EDMInterface
US:_r_EDMInterface
nopaneltrue

 

Options

...

  

OptionComment
Option nameComment

 

Example

...

 

Code Block
languagecpp
 /* Check that the EDMserver have at
 between 5 and 10 application servers available. 
 Return a user defined error message if 
 they are to few or to many */ 
  
 #define S_ETOFEWAPPSERVERS FIRST_USER_DEFINED_ERROR_CODE

...


 #define S_ETOMANYAPPSERVERS (FIRST_USER_DEFINED_ERROR_CODE + 1)

...


 int i;

...


 EdmiError rstat;

...


 SdaiServerContext suContext;

...


 tEdmiWhoIsOnServer *pWhoIsOn;

...


 tEdmiConnection *connect;

...


 SdaiInteger nConnect, nAppServer;

...


 SdaiString hostName, clientName;

...


  
 /* Define Remote Server Context

...


 for the superuser */

...

 
 rstat = edmiDefineServerContext("SuperUserContext",

...


 "superuser", NULL, "xfx56kl9",

...


 "TCP", "9090", "MyServerHost",

...


 NULL, NULL, NULL, NULL, NULL, &suContext);

...

 
  
 /* Define the error code and message */

...


 rstat = edmiRemoteDefineErrorCode(suContext, S_ETOFEWAPPSERVERS,

...


 "To few application servers", REPLACE_EXISTING, NULL);

...

 
  
 rstat = edmiRemoteDefineErrorCode(suContext, S_ETOMANYAPPSERVERS,

...


 "To many application servers", REPLACE_EXISTING, NULL);

...

 
  
 /* Find all application server client Ids */

...


 rstat = edmiRemoteWhoIsOn(suContext, &nConnect, &pWhoIsOn, NULL);

...


 connect = pWhoIsOn->connections;

...


 nAppServer = 0;

...


 for (i=0;i<nConnect;i++) {

...


 rstat = edmiRemoteGetClientNames(suContext, connect->clientId,

...


 &hostName, &clientName, NULL);

...

 
 if (strstr(clientName, "EDMapplicationServer-") &&

...

 
 strstr(clientName, " Main Client") ) {

...

 
 if (++nAppServer > 10) {

...

 
 rstat = S_ETOMANYAPPSERVERS;

...

 
 break;

...

 
 } 
 } 
 edmiFree(hostName);

...

 
 edmiFree(clientName);

...

 
 }
 if (nAppServer < 5) {

...


 rstat = S_ETOFEWAPPSERVERS;

...

 
 }
  
 if (rstat) {

...


 SdaiString _errMsg;

...

 
 edmiRemoteGetErrorText(suContext, rstat, &_errMsg, NULL);

...

 
 printf("\nError %d : %s", rstat, _errMsg);

...

 
 }
 . . .

 

See also

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
cqllabel = "model" and parent = "6062220"