using System; using System.Linq; using System.Text; namespace Core.Util { ///
<summary> /// Exception handling help class /// </summary> public static class ExceptionHelper { ///
<summary> /// Get exception location /// </summary> /// <param name="e"> abnormal </param> ///
<returns></returns> private static string GetExceptionAddr(Exception e) {
StringBuilder excAddrBuilder = new StringBuilder(); e?.StackTrace?.Split("\r\n".
ToArray())?.ToList()?.ForEach(item => { if (item.Contains(" Line number ") || item.Contains
("line")) excAddrBuilder.Append($" {item}\r\n"); }); string addr =
excAddrBuilder.ToString(); return addr.IsNullOrEmpty() ? " nothing " : addr; } ///
<summary> /// Get exception message /// </summary> /// <param name="ex"> Exception caught </param> ///
<param name="level"> Internal exception level </param> /// <returns></returns> private static string
GetExceptionAllMsg(Exception ex, int level) { StringBuilder builder = new
StringBuilder(); builder.Append($
@"{level} Layer error : news :{ex?.Message} position :{GetExceptionAddr(ex)}"); if (ex.InnerException
!= null) { builder.Append(GetExceptionAllMsg(ex.InnerException, level + 1)); }
return builder.ToString(); } /// <summary> /// Get exception message /// </summary> /// <param
name="ex"> Exception caught </param> /// <returns></returns> public static string
GetExceptionAllMsg(Exception ex) { string msg = GetExceptionAllMsg(ex, 1);
return msg; } } }

Technology
©2019-2020 Toolsou All rights reserved,
ElementUI In the select Of label value Python realization switch method use VS2019 “Windows Desktop applications ” Module creation Win32 window Hackbar Using the tutorial ( Essence )2020 year 7 month 15 day Wechat applet import and include difference LED Scrolling text python obtain excel A column or row of data pytorch of ResNet18( Yes cifar10 The accuracy of data classification is achieved 94%)PHP Printout log( Essence )2020 year 6 month 26 day C# Class library GUID Help class