The endpoint my code is calling has a problem, so it is returning a 501 response. All is fine, except the error message in the Flurl exception could be better. One problem is that there seems to be a formatting error with the error message in the system exception (it ends with a quote for some reason). But I also noticed that Flurl repeats the inner exception's error message in its own error message. This adds redundant text coupled with bad formatting making it look bad.
Here are some details (with endpoint info masked):
Flurl.Http.FlurlHttpException message:
Call failed. The proxy tunnel request to proxy 'https://endpointurl' failed with status code '501'.": GET endpointurl?querystring
Inner exception message (System.Net.Http.HttpRequestException)
The proxy tunnel request to proxy 'https://endpointurl' failed with status code '501'."
I don't think there is a good way to fix the double quote (must be Microsoft's problem), but I am wondering if repeating the message from the inner exception is a good practice. In my code I normally go down the exception stack and combine error messages from inner exceptions to get the full error context, so if every exception repeats error messages of every inner exception, it would be a mess.
Stack trace of the FlurlHttpException:
at Flurl.Http.FlurlClient.<HandleExceptionAsync>d__28.MoveNext()
at Flurl.Http.FlurlClient.<SendAsync>d__23.MoveNext()
at Flurl.Http.FlurlClient.<SendAsync>d__23.MoveNext()
at Flurl.Http.ResponseExtensions.<ReceiveJson>d__0`1.MoveNext()
The endpoint my code is calling has a problem, so it is returning a
501response. All is fine, except the error message in the Flurl exception could be better. One problem is that there seems to be a formatting error with the error message in the system exception (it ends with a quote for some reason). But I also noticed that Flurl repeats the inner exception's error message in its own error message. This adds redundant text coupled with bad formatting making it look bad.Here are some details (with endpoint info masked):
Flurl.Http.FlurlHttpExceptionmessage:Inner exception message (
System.Net.Http.HttpRequestException)I don't think there is a good way to fix the double quote (must be Microsoft's problem), but I am wondering if repeating the message from the inner exception is a good practice. In my code I normally go down the exception stack and combine error messages from inner exceptions to get the full error context, so if every exception repeats error messages of every inner exception, it would be a mess.
Stack trace of the
FlurlHttpException: