Share via


CReplicationServer.TranslateEventCode Method

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Retrieves the description, severity, and category for a specified event code.

void TranslateEventCode(int eventCode, out object description, out object severity, out object category)

Parameters

  • eventCode
    The event code to translate.

  • description
    The text that describes the event code.

  • severity
    The severity of the event. The following table lists the event severity levels.

    Name

    Value

    Description

    CSSEVENT_SEVERITY_SUCCESS

    0

    The operation completed successfully.

    CSSEVENT_SEVERITY_INFORMATIONAL

    1

    More information is available about the operation.

    CSSEVENT_SEVERITY_WARNING

    2

    The operation generated a warning.

    CSSEVENT_SEVERITY_ERROR

    3

    The operation generated an error.

  • category
    The category of the event. The following table describes the event categories.

    Name

    Value

    Description

    CSSEVENT_CATEGORY_GENERAL

    0

    General error and other events.

    CSSEVENT_CATEGORY_FILE

    1

    File events, such as sending a file.

    CSSEVENT_CATEGORY_REPLICATION

    2

    Replication events, such as starting a replication.

    CSSEVENT_CATEGORY_ADMIN

    3

    Project events, such as creating a project.

    CSSEVENT_CATEGORY_SUMMARY

    4

    Summary events, such as a replication summary.

Remarks

You must have CSS administrator or operator permissions to call this method.

For a list of warning and error codes that are returned by the CSS APIs, see CSS API Error Handling.

The CReplicationServer.TranslateEventCode method corresponds to the COM method named ReplicationServer.TranslateEventCode.

Example

The following example returns information for an error code that is generated when you try to create a new project that has the same name as an existing project.

CReplicationServer replicationServer = new CReplicationServer();
replicationServer.Initialize("");
  try
  {
      // Attempt to create a duplicate project
      CReplicationProject project = (CReplicationProject)replicationServer.OpenProject("MyProject", CSS_PROJECT_CREATION.CREATE_NEW_PROJECT);
      project.Commit();
  }
  catch (System.Runtime.InteropServices.COMException e)
  {
      object description, severity, category;
      replicationServer.TranslateEventCode(e.ErrorCode, out description, out severity, out category);
      Console.WriteLine("Error description = {0}, severity = {1}, category = {2}", description, severity, category);
  }

See Also

Other Resources

Monitoring Commerce Server Staging

Event Codes for Staging

CSS API Error Handling

CReplicationServer Class