public static Exception ( |
||
e | ||
callStack | bool | |
return | string |
public static string Exception(Exception e, bool callStack = true)
{
if (e == null) return null;
string eName = Type(e.GetType());
string eSite = e.TargetSite != null ? MemberInfo(e.TargetSite) : null;
return string.Format(System.Globalization.CultureInfo.InvariantCulture,
"{0}{1}: {2}{4}CallStack:{4}{3}",
eName,
eSite != null ? " at " + eSite : "",
e.Message,
e.StackTrace,
Environment.NewLine);
}
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); } }