public static string GetSafeSenderStringValue(GetStringValue getString) { string txt = null; try { txt = getString(); } catch { txt = ""; } return(txt); }
public static string GetSafeSenderStringValue(GetStringValue getString) { string txt = null; try { txt = getString(); } catch (Exception e) { e.ReportException(); txt = ""; } return(txt); }
public static string GetSafeSenderStringValue(GetStringValue getString) { string txt = null; try { txt = getString(); } #pragma warning disable CA1031 // Do not catch general exception types catch (Exception e) { e.ReportException(); txt = ""; } #pragma warning restore CA1031 // Do not catch general exception types return(txt); }
public static string GetSafeSenderStringValue(GetStringValue getString) { if (getString == null) { throw new ArgumentNullException(nameof(getString)); } string txt = null; try { txt = getString(); } #pragma warning disable CA1031 // Do not catch general exception types catch (Exception e) { e.ReportException(); txt = ""; } #pragma warning restore CA1031 // Do not catch general exception types return(txt); }