Repository.XFRACAS.WriteExceptionToDiagnosticsLog: Difference between revisions
Jump to navigation
Jump to search
Kate Racaza (talk | contribs) |
Kate Racaza (talk | contribs) No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:Repository.XFRACAS.WriteExceptionToDiagnosticsLog Method}}{{Template:API}}{{Template:APIBreadcrumb|.[[Repository Class|Repository]]}} | |||
Line 21: | Line 21: | ||
== Example == | == Example == | ||
The following example demonstrates how to write messages and exceptions to the XFRACAS diagnostics log. | The following example demonstrates how to write messages and exceptions to the XFRACAS diagnostics log. | ||
'''VB.NET''' | '''VB.NET''' |
Latest revision as of 16:45, 10 March 2016
Member of: SynthesisAPI.Repository
Writes exception information to the XFRACAS diagnostics log.
Syntax
.WriteExceptionToDiagnosticsLog (exObject, entryType, comment)
Parameters
exObject
- Required. Exception. Represents the error that occurred during application execution.
entryType
- Required. The XFRACAS diagnostics type. Can be any XFRACASDiagnosticsEntryType enumeration.
comment
- Optional. String. The text to write to the XFRACAS diagnostics log.
Example
The following example demonstrates how to write messages and exceptions to the XFRACAS diagnostics log.
VB.NET 'Connect to the Synthesis enterprise repository. Dim MyRepository As New Repository Dim Success As Boolean Success = MyRepository.ConnectToSQLRepository ("MyServer", "MyDatabase") 'Record a message to diagnostic log if the connection to the repository is successful. If Success Then MyRepository.XFRACAS.WriteMessageToDiagnosticsLog("Successfully connected to repository", XFRACASDiagnosticsEntryType.Information) 'Get a list of all XFRACAS entities connected to the repository. Try Dim ListOfXFRACASEntities() As NameIdPair ListofXFRACASEntities = MyRepository.XFRACAS.GetAllXFRACASEntities Dim i As Integer For i = 0 To ListOfXFRACASEntities.GetUpperBound(0) MessageBox.Show(ListOfXFRACASEntities(i).Name) Next Catch Ex As Exception 'Write error message to diagnostics log. MyRepository.XFRACAS.WriteExceptionToDiagnosticsLog(Ex, XFRACASDiagnosticsEntryType.Error, "Reading Entities") End Try End If