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.)
EventNotify
receives the following constants depending on the severity of the
error:
Event_Warning
Event_Severe
Event_Notify_Severe
EventNotifyInfo receives any supplemental information regarding the error.
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.ElseIf Severity = Event_Warning Then
Form1.Text1 = Form1.Text1 & "Code: " & CStr(ErrorCode) & ", Notification: " & CStr(ErrorDescription) & vbCrLf
Form1.Text1.SelStart = Len(Form1.Text1)
DoEvents' Any warnings sent by FREDI is captured here.ElseIf Severity = Event_Severe Then
Form1.Text1 = Form1.Text1 & "Warning Code: " & CStr(ErrorCode) & ", Warning Description: " & ErrorDescription & vbCrLf
Form1.Text1.SelStart = Len(Form1.Text1)
DoEvents' Any severe errors sent by FREDI is captured here.End If
Form1.Text1 = Form1.Text1 & "Severe Code: " & CStr(ErrorCode) & ", Severe Description: " & ErrorDescription & vbCrLf
Form1.Text1.SelStart = Len(Form1.Text1)
DoEvents
End Sub