Skip to content

Error in ExceptionReportInterpreter #7

@filippobottega

Description

@filippobottega

Hello,
ExceptionReportInterpreter fails due to an error in s_regexStackTraceLine field.

        // Regex for the stack frame line, it looks like this:
        // <space> at AssemblyName!0x<hex method token>!Namespace.Class.Method(<arg types>) +0x<hex IL Offset>
        //         at MyAssembly!0x1234567!MyAssembly.Class1.A() +0xc

        private static readonly Regex s_regexStackTraceLine =
            new Regex(@"^\s*at\s+(?<Assembly>[^<>:\""/\\|?*\u0000-\u001f!]+)!0x(?<MDToken>[0-9a-f]+)!(?<Method>[^\(]+)\((?<Args>[^\)]*)\)\s+\+0x(?<ILOffset>[0-9a-f]+)", RegexOptions.Singleline | RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);

but "at" word is wrong if the culture is not en-en because:

    /// <summary>
    /// Main reporting entry point.
    /// </summary>
    public static class ExceptionReporting
    {
...
        /// <summary>
        /// Internal logic - adapted from Environment.GetStackTrace from .NET BCL.
        /// </summary>
        /// <param name="ex"></param>
        /// <param name="ctx"></param>
        /// <param name="builder"></param>
        private static void GetStackTraceEx(Exception ex, ExceptionReportingContext ctx, ref StringBuilder builder)
        {
            var st = new StackTrace(ex);
            var strAt = GetRuntimeResourceString("Word_At") ?? "at";

Best regards,
Filippo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions