Skip to content

Conversation

@SteveSandersonMS
Copy link
Member

Previously we used Console.Error.WriteLine. However this is implemented as the stderr stream, which has no message framing, so the recipient has no way to know how successive lines correspond to the original Console.Error.WriteLine calls. So there's no way of putting the lines into groups, hence they each are treated as separate console.error calls, hence each line emits its own separate stack trace, leading to #20280.

The fix is to have a separate dedicated channel for unhandled exception info.

@SteveSandersonMS SteveSandersonMS added area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly labels Apr 16, 2020
// runtime will do if it encounters a truly severe error outside the Blazor
// code paths.
Console.Error.WriteLine(formattedMessage);
_jsRuntime.InvokeVoid("Blazor._internal.dotNetCriticalError", formattedMessage);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unmarshalled?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, that's a good idea. Most times it will make no difference, but I guess if the exception is something like "S.T.J. is somehow completely broken" then we don't want to rely on S.T.J. during the reporting of that error.

Done.

@captainsafia captainsafia changed the base branch from stevesa/cdn to blazor-wasm April 16, 2020 20:18
@captainsafia captainsafia changed the base branch from blazor-wasm to stevesa/cdn April 16, 2020 20:18
@captainsafia
Copy link
Member

Changed around the base branches so that the build on this can re-kick. I'll monitor this build.

@SteveSandersonMS
Copy link
Member Author

Thanks @captainsafia! I've noticed a bug in the new E2E test in stevesa/cdn so this is going to fail on the current build. I'm making a fix in the underlying branch then will re-trigger this.

@SteveSandersonMS SteveSandersonMS changed the base branch from stevesa/cdn to blazor-wasm April 16, 2020 20:45
@captainsafia captainsafia changed the base branch from blazor-wasm to stevesa/cdn April 16, 2020 21:22
@captainsafia captainsafia reopened this Apr 16, 2020
@captainsafia
Copy link
Member

Merging this into the other branch now!

@captainsafia captainsafia merged commit 85c5f68 into stevesa/cdn Apr 17, 2020
@captainsafia captainsafia deleted the stevesa/error-grouping branch April 17, 2020 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants