Imports DigitalData.Modules.Logging Public Class FormHelper Private ReadOnly Logger As Logger Public Sub New(pLogConfig As LogConfig) Logger = pLogConfig.GetLogger() End Sub Public Sub ShowError(pException As Exception, pFunction As String, Optional pDetails As String = "") Dim oMessage = String.Format(My.Resources.frmShared.In_der_Funktion___0___ist_folgender_Fehler_aufgetreten___1_, pFunction, vbNewLine & vbNewLine & pException.Message) If pDetails <> String.Empty Then oMessage &= $"{vbNewLine}{pDetails}" End If Logger.Error(pException) MsgBox(oMessage, MsgBoxStyle.Critical, Application.ProductName) End Sub End Class