Errors not catchable

I am on the task to handling the potential lose of internet connection at different points in my app.
So starting with auth. I struggle to properly catch the errors. Errors pause the editor.

                       await AuthenticationService.Instance.SignInAnonymouslyAsync();
                    catch (AuthenticationException ex)
                    catch (RequestFailedException ex)


I also did it in a seperate function returning a task as mentioned here:

Still the errors are not catched!
The only time I get the error message printed myself is through an event subscription

AuthenticationService.Instance.SignInFailed += OnFailedSignIn;


Nevermind I just realized we are logging as Exception. After changing both to Debug.Log(

Only one error remains, but still editor stopping.

[Authentication]: Request failed: 0, Cannot resolve destination host

Its that one coming from the Service api:

Is there another way of solving that so we dont have the editor paused?

Do you have Error Pause on for the Console window in the Unity Editor?

Hi @JeffDUnity3D ,
yes your right I did not know I can turn this off, thanks!

But still shouldnt I be able to catch all errors?
I dont like seeing red stuff in the console. Would be nice if the try catch just prevents that message.

Maybe its just a nice to have..

We will look to remove unwanted error logs, we agree they should not be forced on you if you are handling the exceptions

1 Like