Giter VIP home page Giter VIP logo

Comments (8)

Anu6is avatar Anu6is commented on July 30, 2024 1

I think you guys are discussing two different things.
@MBNSoftware is addressing how to address the specific exception scenario you gave as an example. While @d00lar is simply saying that the basic unhandled exception catch all logic is missing from the template. The issue raised has nothing to do with awaiting a task or not but what happens when an unhandled exception occurs.

The issue was also brought up on the template repo #451

from templates.

jperson2000 avatar jperson2000 commented on July 30, 2024 1

Hi everyone, as part of upgrading templates for the upcoming MudBlazor 7.0.0 release, I rebuilt templates from scratch and the error <div> is there. You can find the change in this PR: #465

from templates.

MBNSoftware avatar MBNSoftware commented on July 30, 2024

Hello,

Could this "help" ?

https://medium.com/@alexandre.malavasi/why-exceptions-in-async-methods-are-dangerous-in-c-fda7d382b0ff

To summarize, it's mainly because the Task is not (may not be) awaited. Which is potentially understandable if the original method was not a task : the calls to it were not "awaited".

So I would not qualify this as a bug but rather as a bad programming practice (no offence to you, of course).

Regards,
Christophe

from templates.

d00lar avatar d00lar commented on July 30, 2024

Yes i known all that
but best practise is best practise
and life is life / sometimes someone can forget something
but still
in default .net template
there is some 'bar' at the bottom of page with reload btn as You probably known
so same thing im expecting in mudblazor template?
in .net6 template of mudblazor WebAssembly it was
but in .net 8 template for 'server side' project there is not - this DIV is missing
with this as i wrote

An unhandled error has occurred. Reload 🗙

this is as expected - do You think it should not be there anymore?
regards

from templates.

MBNSoftware avatar MBNSoftware commented on July 30, 2024

To be honest, as I feel it's a "bad programming practice", I would not even try to solve this. It would add mess where there's already enough, I think.

Don't get me wrong, though, I understand your need to handle such exception in a task. But, as many sources seem to agree, the correct way to handle it properly is to await the call. Period.
I'm not skilled enough to go against that, hence my advice to (try to) stay with good practice. Again, no offence but pure common sense or pragmatism,

Regards,
Christophe

from templates.

d00lar avatar d00lar commented on July 30, 2024

so You guys think that default blazor option for handling unhandled exceptions - 'Down bar showing that some error occured and You can try reload'
is not needed anymore? but it was needes sometimes ago..? in mudblazor older / webassembly template? from witch version this concept is abbanden?

from templates.

d00lar avatar d00lar commented on July 30, 2024

exacly - it is just example nothing more.
also it just 'freaze app' when this div is missing so if some unaware developer will hit this kind of error - he can wait even hour or two waiting for task to compleat seeing no error or no sign of something bad happened.

from templates.

ScarletKuro avatar ScarletKuro commented on July 30, 2024

Transferred the issue to MudBlazor/Templates repo

from templates.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.