question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loader.Error not changing on Exception

See original GitHub issue

Hi Jean

I don’t think this is a bug in your library, might just be a misunderstanding on my part. Earlier today I was simulating a scenario whereby a user doesn’t have an internet connection, wifi’s off, mobile data on but they don’t have data. I set the HttpClient’s timeout to 30 seconds, when the TaskCanceled exception is thrown, there’s no property changed event from the TaskLoaderNotifier like how there usually is for other errors, I usually check Loader.Error and handle errors based on what’s there. Am I missing anything?

Here’s a sample that replicates the issue

Thanks again for the library Jean!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
clifzerocommented, Aug 17, 2020

Everything you mentioned above is exactly what I’m doing. In the meantime let me show you my ugly workaround 😁

if (e.PropertyName == "Error")
            {
                if (Loader.Error != null)
                {
                    if (Loader.IsFaulted && ! Loader.IsCanceled)
                    {
                        TaskMonitor.Create(HandleErrorAsync);
                     }
                }

                else if (Loader.Error == null)
                {
                    if (Loader.IsFaulted && Loader.IsCanceled)
                    {
                        Loader.Error = new TaskCanceledException();
                    }
                }


            }
            if (e.PropertyName == "IsFaulted")
            {
                if (Loader.IsFaulted && Loader.IsCanceled)
                {
                    Loader.Error = new Exception();
                }
            }
1reaction
clifzerocommented, Aug 17, 2020

100% right it is a state, I’ll have a look and let you know if I can setup a global configuration for task loader through task monitor. Thanks Jean!

Read more comments on GitHub >

github_iconTop Results From Across the Web

c++ - Exception mechanism not working
if you want exception handling - your loader must use LdrLoadDll or LoadLibrary[Ex] for load your code. no another way. and are thread...
Read more >
add exception handler for DataLoader when reading a ...
Currently, the data loader just crashes if dataset.__getitem__(index) failed (i.e. when reading a damaged image file).
Read more >
[Bug]: Unhandled exception in the data loader does not ...
This exception causes the errorElement to render (good and expected) but the error itself is never printed to the JavaScript console using ...
Read more >
Field integrity exception updating with data loader
The error cause is that the Opp record could not be edited because Stage="Order In" and there is a validation rule saying that...
Read more >
Class loading exceptions
ClassNotFoundException. A class not found exception results when the following conditions exist and can be corrected by the following actions: The class is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found