Real-Serious-Games / C-Sharp-Promise

Promises library for C# for management of asynchronous operations.
MIT License
1.2k stars 149 forks source link

Exceptions are not caught in Done (in Unity) #14

Closed besttof closed 8 years ago

besttof commented 8 years ago

If you have a Promise that throws a null reference error in Done, it gets eaten and won't be visible in Unity.

e.g. If you have this field and leave it empty: [SerializeField] UnityEngine.UI.Image _testImage

And then run a promise like this:

TestPromise()
.Catch(e => Debug.LogException(e))
.Done(_image.color = Color.red);

The body of Done would throw a null reference exception, but it never shows up in Unity's console and it silently stops execution.

ashleydavis commented 8 years ago

This is fixed now. Thanks for reporting the issue.

Exceptions in Done are now passed to the 'unhandled exception' handler.

Changes have been pushed back to github and version 1.1.8 of the promise library has been released on nuget.

Please test it on your end and reopen this issue if you still have problems.