I have a function that gets a PDF file from the blob storage and returns it. Once in a while, I get a socket-exhausted exception. This is probably an issue with another function that reads a lot of data from a Storage Table. I'm in to process of mitigating that exception but when it occurs the first function returns the stack trace to the user which I do not want.
How can I prevent the function from returning the stack trace?
I've searched using Google and found mostly questions from people that want the stack trace, which is very hard in Azure Function. But I want to opposite. Don't show the stack trace, just return a 500 or something.