Skip to content

Commit

Permalink
Merge pull request #1848 from Microsoft/johtaylo/warn-and-order
Browse files Browse the repository at this point in the history
improved error message for connection failure and order of state trace
  • Loading branch information
cleemullins authored May 1, 2019
2 parents 84553c4 + 6f89dc3 commit 295c941
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public async Task<bool> SendAsync(Activity activity, CancellationToken cancellat
}
catch (Exception err)
{
_logger.LogWarning($"Exception sending to inspection endpoint {err.ToString()}");
_logger.LogWarning($"Exception '{err.ToString()}' while attempting to call Emulator for inspection, check it is running, and you have correct credentials in the Emulator and the InspectionMiddleware.");
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ async Task IMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate next,
await InvokeOutboundAsync(ctx, traceActivity, cancellationToken).ConfigureAwait(false);
await nextDelete().ConfigureAwait(false);
});

await InvokeTraceStateAsync(turnContext, cancellationToken).ConfigureAwait(false);
}

if (shouldForwardToApplication)
Expand All @@ -63,6 +61,11 @@ async Task IMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate next,
throw e;
}
}

if (shouldIntercept)
{
await InvokeTraceStateAsync(turnContext, cancellationToken).ConfigureAwait(false);
}
}

protected abstract Task<(bool shouldForwardToApplication, bool shouldIntercept)> InboundAsync(ITurnContext turnContext, Activity traceActivity, CancellationToken cancellationToken);
Expand Down

0 comments on commit 295c941

Please sign in to comment.