|
Windows Clients
Error ReportingIf the call succeeds in obtaining a workspace, the method returns S_OK. However, there are many reasons an error may occur. Sometimes an error can occur even before the connection attempt is made. The following is an example of such an error:
Other errors can occur during the connection attempt. Examples include the following:
Errors can occur even though a successful connection is established. Errors that occur when connecting are reported either through the IErrorInfo mechanism (if no SAS workspace is created) or returned in the errorString parameter (if a SAS workspace is created.) The Err.Description (IErrorInfo->Description() in C) and errorString both use the same format which is XML. If UseXMLInErrorInfo is set to false (it defaults to true), Err.Description will only contain a single error string, that refers to the last connection attempted. Error XMLThe error information returned through XML allows applications to fix the problems detected. Applications interested in fixing these errors will need to parse the XML and possibly provide a UI to the user, or send a message to the administrator to get the errors fixed so they don't occur again. Here is a sample of the error XML that gets generated (and returned in the errorString parameter of either CreateWorkspaceByLogicalName or CreateWorkspaceByServer) when there is a successful connection made, but the first attempt failed: <connectionAttempts> <connectionAttempt> <sasservername>MyServer</sasservername> <machineDNSName>MyServer.MyCompany.com</machineDNSName> <saslogin>MyUserID</saslogin> <status>0x8004274d</status> <description>Could not establish a connection to the SAS server on the requested machine. Verify that the SAS server has been started with the -objectserver option or that the SAS spawner has been started. Verify that the port Combridge is attempting to connect to is the same as the port SAS (or the spawner) is listening on.</description> </connectionAttempt> <connectionAttempt> <sasserver>MyServer</sasserver> <machineDNSName>MyServer.MyCompany.com</machineDNSName> <saslogin>MyUserID</saslogin> <status>0x0</status> <description>Connected</description> </connectionAttempt> </connectionAttempts> |