async Task GetReturnValue() { try { await task; } catch (Exception ex) { invocationInfo.Exception = ex; Logger.Fatal("{target} failed: {exception}", invocationInfo, InvocationFailed.ShortMessage(ex)); throw new InvocationFailed(ex, invocationInfo); } finally { invocationInfo.Complete(); } }
async Task <Result> GetReturnValue() { try { var r = await task; r = (Result)invocationInfo.InterceptReturnValue(r); return(r); } catch (Exception ex) { invocationInfo.Exception = ex; Logger.Fatal("{target} failed: {exception}", invocationInfo, InvocationFailed.ShortMessage(ex)); throw new InvocationFailed(ex, invocationInfo); } finally { invocationInfo.Complete(); } }