Click or drag to resize

EAPEventArgsError Method (String, String, ExceptionOptions)

Sets the extention's result code and error message for this event with an optional developer-specific error message and options. The result code is set to Error.

Namespace:  NetQuarry
Assembly:  EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.6.8.0)
Syntax
public void Error(
	string userMessage,
	string developerMessage = null,
	ExceptionOptions options = 
)

Parameters

userMessage
Type: SystemString
The error message.
developerMessage (Optional)
Type: SystemString
An optional, developer-specific error message. This will be logged to the Devlog and xot_request_log, but only displayed in user error messages when the user is identified as IsDeveloper.
options (Optional)
Type: NetQuarryExceptionOptions
Options used to specify additional characteristics about an exception.
Remarks
Note that this method does not stop execution of the current function call.
Examples
This sample shows how to use the Error method.
public class XExt : NetQuarry.MapperExtensionKernel
{
   public override void FieldButtonClick(IField sender, EAPEventArgs e)
   {        
      if (0 == EAPUtil.ToString(sender.Fields["company_name"].Value).Length)
      {
          string    id = EAPUtil.ToString(sender.Fields["company_id"].Value);

          e.Error("You must provide a Company Name before executing this command.", "ID = " + id, ExceptionOptions.DoNotLogToRequestLog);
          return;
      }
   }
}
See Also