Error Reporting by Event Notification

A client application can receive errors from Framework EDI (FREDI) immediately as they are discovered by FREDI via events.  Errors are passed back to the client application through the following callback functions. (For more information, see Events.)

For example in Visual Basic, the following code shows how an event handler can watch only for errors passed by events.

Private Sub m_oEdiDoc_EventNotify(ByVal Severity As Fredi.EventIDConstants, ByVal ErrorCode As Long, ByVal ErrorDescription As String)

If Severity = Event_Notify_Severe Then

' Any sever errors (that does not stop an operation) sent by FREDI is captured here.
Form1.Text1 = Form1.Text1 & "Code: " & CStr(ErrorCode) & ", Notification: " & CStr(ErrorDescription) & vbCrLf
Form1.Text1.SelStart = Len(Form1.Text1)
DoEvents
ElseIf Severity = Event_Warning Then
' Any warnings sent by FREDI is captured here.
Form1.Text1 = Form1.Text1 & "Warning Code: " & CStr(ErrorCode) & ", Warning Description: " & ErrorDescription & vbCrLf
Form1.Text1.SelStart = Len(Form1.Text1)
DoEvents
ElseIf Severity = Event_Severe Then
' Any severe errors sent by FREDI is captured here.
Form1.Text1 = Form1.Text1 & "Severe Code: " & CStr(ErrorCode) & ", Severe Description: " & ErrorDescription & vbCrLf
Form1.Text1.SelStart = Len(Form1.Text1)
DoEvents
End If

End Sub