Skip to content

Conversation

alefranz
Copy link
Contributor

The MessageHandler throws when used outside of a request.
This reword the exception to clarify that this could be another possible cause of it.

Also fixes a missing ' in the current message.

Related to #12169, but not a final fix

@rynowak I have a couple questions:

  • What is the best way to describe an incoming request of the pipeline? Open for suggestions on how to better word this message.
  • I guess this is it for now. We could use the HttpContextAccessor to distinguish between the two types of errors and have a specific message, but this can add a performance hit if not already registered. Unless we use it only if it is available and fallback to this generic exception message otherwise. However adding a dependency only to have a better error message feels wrong.

/cc @anurse

Copy link
Contributor

@analogrelay analogrelay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wordsmithing! Would like @rynowak to confirm all is in the right place (and my words are good), but otherwise LGTM

$"initialized. Register the header propagation middleware by adding 'app.{nameof(HeaderPropagationApplicationBuilderExtensions.UseHeaderPropagation)}() " +
$"in the 'Configure(...)' method.";
$"initialized. Register the header propagation middleware by adding 'app.{nameof(HeaderPropagationApplicationBuilderExtensions.UseHeaderPropagation)}()' " +
$"in the 'Configure(...)' method. Also, do not use an HttpClient with header propagation outside of an incoming HTTP request.";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$"in the 'Configure(...)' method. Also, do not use an HttpClient with header propagation outside of an incoming HTTP request.";
$"in the 'Configure(...)' method. Header propagation can only be used within the context of an HTTP request.";

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@alefranz alefranz force-pushed the headerpropagation-rewordedregistrationexception branch from 5c249ec to ea8de36 Compare July 27, 2019 11:23
Copy link
Contributor

@analogrelay analogrelay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I'll take a look at the CI failures. They may not be related.

@analogrelay
Copy link
Contributor

Yeah, looks like a timeout. Re-running.

@alefranz
Copy link
Contributor Author

CI looks good now

@rynowak rynowak merged commit c23b9fe into dotnet:master Jul 27, 2019
@rynowak
Copy link
Member

rynowak commented Jul 27, 2019

Thanks @alefranz

alefranz added a commit to alefranz/HeaderPropagation that referenced this pull request Oct 27, 2019
alefranz added a commit to alefranz/HeaderPropagation that referenced this pull request Oct 27, 2019
alefranz added a commit to alefranz/HeaderPropagation that referenced this pull request Oct 27, 2019
alefranz added a commit to alefranz/HeaderPropagation that referenced this pull request Oct 27, 2019
c29m added a commit to c29m/HeaderPropagation that referenced this pull request Mar 2, 2023
@amcasey amcasey added the area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares label Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares tell-mode Indicates a PR which is being merged during tell-mode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants