Skip to content

Copying exceptions from the browser console is hard #20280

@danroth27

Description

@danroth27

If an unhandled exception occurs in a Blazor WebAssembly app it shows up in the browser console:

image

But copying this error information is pretty messy. If I try to just select and do a copy & paste I get something like this:

Failed to load resource: the server responded with a status of 500 ()
blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
p.printErr @ blazor.webassembly.js:1
blazor.webassembly.js:1       Unhandled exception rendering component: Could not load settings from '_configuration/Microsoft.AspNetCore.Components.WebAssembly.Authentication'
p.printErr @ blazor.webassembly.js:1
blazor.webassembly.js:1       Error: Could not load settings from '_configuration/Microsoft.AspNetCore.Components.WebAssembly.Authentication'
p.printErr @ blazor.webassembly.js:1
blazor.webassembly.js:1           at Function.createUserManager (https://localhost:44381/_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js:1:4664)
p.printErr @ blazor.webassembly.js:1
blazor.webassembly.js:1           at async Function.init (https://localhost:44381/_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js:1:4124)
p.printErr @ blazor.webassembly.js:1
blazor.webassembly.js:1 Microsoft.JSInterop.JSException: Could not load settings from '_configuration/Microsoft.AspNetCore.Components.WebAssembly.Authentication'
p.printErr @ blazor.webassembly.js:1
blazor.webassembly.js:1 Error: Could not load settings from '_configuration/Microsoft.AspNetCore.Components.WebAssembly.Authentication'
p.printErr @ blazor.webassembly.js:1
blazor.webassembly.js:1     at Function.createUserManager (https://localhost:44381/_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js:1:4664)
p.printErr @ blazor.webassembly.js:1
blazor.webassembly.js:1     at async Function.init (https://localhost:44381/_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js:1:4124)
p.printErr @ blazor.webassembly.js:1
blazor.webassembly.js:1   at System.Threading.Tasks.ValueTask`1[TResult].get_Result () <0x2dbdc40 + 0x0002c> in <filename unknown>:0 
...

Is there anyway we can make it easier and cleaner to report this error information?

Metadata

Metadata

Labels

DoneThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssembly

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions