You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1011 B

Imports Microsoft.VisualBasic.ApplicationServices.Debugging.Diagnostics
Public Class IPCError
Public Property message As String
Public Property stackTrace As StackFrame()
Public Property inner As IPCError
Public Property exceptionName As String
Sub New()
End Sub
Sub New(ex As Exception)
exceptionName = ex.GetType.Name
message = ex.Message
stackTrace = ExceptionData.ParseStackTrace(ex.StackTrace)
If Not ex.InnerException Is Nothing Then
inner = New IPCError(ex.InnerException)
End If
End Sub
Public Iterator Function GetAllErrorMessages() As IEnumerable(Of String)
If Not inner Is Nothing Then
For Each msg As String In inner.GetAllErrorMessages
Yield msg
Next
End If
Yield $"{exceptionName}: {message}"
End Function
Public Overrides Function ToString() As String
Return $"{exceptionName}: {message}"
End Function
End Class