Exception() 공개 정적인 메소드

Returns a string that can be used for representing an exception in log entries. It usually does not include the full call stack and is significantly shorter than an Exceptions ToString method.
public static Exception ( Exception e, bool callStack = true ) : string
e System.Exception
callStack bool
리턴 string
예제 #1
0
        private static Resource ResolveContent(string path)
        {
            if (string.IsNullOrEmpty(path) || ResourceResolve == null)
            {
                return(null);
            }

            ResourceResolveEventArgs args = new ResourceResolveEventArgs(path);

            try
            {
                ResourceResolve(null, args);
            }
            catch (Exception e)
            {
                Log.Core.WriteError("An error occurred in custom ResourceResolve code: {0}", Log.Exception(e));
            }

            if (args.Handled)
            {
                if (string.IsNullOrEmpty(args.Result.Path))
                {
                    args.Result.Path = path;
                }
                AddContent(path, args.Result);
                return(args.Result);
            }
            else
            {
                return(null);
            }
        }