Hello @Scoot-3223 and welcome to Microsoft Q&A.
Thank you for such a well written question. I see you have done some research already.
I used your simple test function to repro the issue, with 1 alteration; I added my name to the message so I can differentiate from some standard message. However, I saw the exception message was returned! I tested this with both Web Activity and Azure Function Activity in ADF. I see it in "Error details" rather than "Output". I tested with both a debug run and a "trigger now".
The Function Activity's, error:
Call to provided Azure function 'FailHttp' failed with status-'InternalServerError' while invoking 'GET' on 'https://failfunc.azurewebsites.net' and message - 'Martin's Exception was raised'.
The Web activity's error:
Martin's Exception was raised
I know you didn't say anything about Web activity, but I like to use it for comparison.
Since our experiences differed so wildly, I'd like to verify whether you were checking the output or the errors for your response body. ... ohh, now I get what you are asking! You are asking about the design decision to make the same message component have different jsonpath depending upon response code.
Yes, technically, the response body is the response body no matter the error code from a raw point of view.
However having them different protects code assuming success from running on error message instead of data.
Also, with the design decision to make status codes 400/500 result in an activity failure, we want the Function activity to behave similar to how other activities behave on failure/error behavior. Make the failure/error output align across different activities. To this end, we need a error message or other detail to pass along with the code. While we could put a standard explanation of the status code, using the response body is richer and respects the endpoint's intent more. Where else could the error message come from?
Did I answer your question, or are you really missing the message even in the error class? I wonder if there is a character limit to that. Stack traces can get very large.
Hope this will help. Please let us know if any further queries.
------------------------------
- Please don't forget to click on
or upvote
button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
- Want a reminder to come back and check responses? Here is how to subscribe to a notification
- If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators