Class ErrorMessage
Describes a single runtime error.
Inherited Members
Namespace: Attachmate.Verastream.HostIntegrator.ScriptAPI
Assembly: Attachmate.Verastream.HostIntegrator.ScriptAPI.dll
Syntax
[Serializable]
public class ErrorMessage
Remarks
An ErrorMessage has an error code, zero or more parameters, generic error text, and localized error text. Error parameters can either be objects of type string or integer. Objects of this type are immutable.
To create an ErrorMessage object in an event handler, use the
appropriate <xref href="Attachmate.Verastream.HostIntegrator.ScriptAPI.IEvent.CreateErrorMessage(System.Int32%2cSystem.Object%5b%5d)" data-throw-if-not-resolved="false"></xref>
method.
Constructors
ErrorMessage(int, object[], string, string)
Construct an ErrorMessage.
Declaration
public ErrorMessage(int code, object[] parameters, string mesg, string localizedMesg)
Parameters
| Type | Name | Description |
|---|---|---|
| int | code | error code |
| object[] | parameters | message parameters |
| string | mesg | generic message text |
| string | localizedMesg | localized message text |
ErrorMessage(int, string, string)
Construct an ErrorMessage.
Declaration
public ErrorMessage(int code, string mesg, string localizedMesg)
Parameters
| Type | Name | Description |
|---|---|---|
| int | code | error code |
| string | mesg | generic message text |
| string | localizedMesg | localized message text |
Fields
USER_GENERIC
Error code for a generic user-defined error.
Declaration
public static readonly int USER_GENERIC
Field Value
| Type | Description |
|---|---|
| int |
Properties
ErrorCode
Return the error code.
Declaration
public virtual int ErrorCode { get; }
Property Value
| Type | Description |
|---|---|
| int | returns code representing error condition |
LocalizedText
Get a localized textual description of the error.
Declaration
public virtual string LocalizedText { get; }
Property Value
| Type | Description |
|---|---|
| string | returns localized error text |
ParameterCount
Get the number of parameters in this error message.
Declaration
public virtual int ParameterCount { get; }
Property Value
| Type | Description |
|---|---|
| int | returns number of parameters |
Text
Get a textual description of the error.
Declaration
public virtual string Text { get; }
Property Value
| Type | Description |
|---|---|
| string | returns error text |
Methods
GetParameter(int)
Get a specific parameter.
Declaration
public virtual object GetParameter(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | parameter index |
Returns
| Type | Description |
|---|---|
| object | error parameter as String or Integer |
ToString()
Returns a textual description of the error.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | returns the text of this error message |