Closed AllFatherGray closed 5 years ago
This is intended behaviour. From version 3.0, you can return a value from a .Catch
to be used in a later then:
var defaultValue = "foo";
FunctionReturningPromise()
.Catch(ex => {
Console.Error(ex.Message);
return defaultValue;
})
.Then(v => Console.Log(v));
This means that, like JavaScript promises, if your .Catch
handler doesn't return a value, no value will be passed through and you will end up with a non-value promise (IPromise
as opposed to IPromise<T>
).
To work around this, you should either return a default value in your .Catch
handler or move the error handling outside of the function returning the promise.
Thanks for the response. The new behavior is intended so this issue is closed.
Old Code: `
public override IPromise
`
After moving from 2.6 to 3.00 the compiler reports an error stating that Catch is returning IPromise instead of IPromise
Have I missed something or is this a bug?