Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in ExceptionReportInterpreter #7

Open
filippobottega opened this issue Dec 20, 2016 · 1 comment
Open

Error in ExceptionReportInterpreter #7

filippobottega opened this issue Dec 20, 2016 · 1 comment

Comments

@filippobottega
Copy link
Contributor

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.

@icnocop
Copy link

icnocop commented Feb 27, 2018

@erlinghaugstad created pull #12 to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants