I was writing a Azure function with service bus trigger while I noticed that if there is any exception occurred, after certain times of built-in retries, it will put the incoming message into the dead letter queue (or called poison-queue? in microsoft document, however, I am not able to get or add any additional information from the DLQ. For example, I am trying to convert 1000 record but 1 of the record convert failed due to invalid data type, then the exception throws and my function ends its work, what the exception looks like, why and when it generated or what would my data looks like when exception happened were all not be able to capture in DLQ message.
I tried to customized the exception object to add more information but seems like it won't affect the way that message sent to the dead-letter-queue. Is that how dead-letter-queue designed that it would only move the message from standard queue to DLQ when exception happened?
What would be the best way that I can handle my exception within the azure function? According to Microsoft we recommend that you use try-catch blocks in your function code to catch any errors., should I put my exception in another queue and let another service to take a look or handle from the other side?