TypedEventHandler does not forward Error in RequestCallback method
bugbytesinc opened this issue · comments
In the TypedEventHandler
within the Core project, there is a missing edge case where an Error attached to the result is not forwarded for further processing. At this line:
we have:
if (rea.Response != null || rea.Error != null)
{
await _ref.MessageHandler.SendResult<T, TR>(arg2.Id, arg1, rea.Response);
}
If the Response
is null because the Error
is not, the error is not propagated to the, would suggest something like the following instead:
if (rea.Error != null)
{
await _ref.MessageHandler.SendError<T, TR>(arg2.Id, arg1, rea.Error);
}
else if (rea.Response != null)
{
await _ref.MessageHandler.SendResult<T, TR>(arg2.Id, arg1, rea.Response);
}
This follows the patterns seen elsewhere in the code.