From ed5da920154ff978a3cf9fbe11db2025a64cbfbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=93=E3=81=AE=E4=B8=AD=E4=BA=8C=E7=97=85=E3=81=AB?= =?UTF-8?q?=E7=88=86=E7=84=94=E3=82=92=EF=BC=81?= Date: Wed, 27 Jan 2021 09:10:19 +0800 Subject: [PATCH] parse IPC error --- Parallel/IpcParallel/Stream/Error.vb | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Parallel/IpcParallel/Stream/Error.vb b/Parallel/IpcParallel/Stream/Error.vb index fe0d444..a0a8f0b 100644 --- a/Parallel/IpcParallel/Stream/Error.vb +++ b/Parallel/IpcParallel/Stream/Error.vb @@ -13,11 +13,25 @@ Public Class IPCError Sub New(ex As Exception) exceptionName = ex.GetType.Name message = ex.Message - stackTrace = {StackFrame.Parser(ex.StackTrace)} + 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