question

RishabhJain-3518 avatar image
0 Votes"
RishabhJain-3518 asked PramodValavala-MSFT answered

Result Code in Azure Function

How to set result code in node js azure function (timer trigger) if any failure occurs ? Ex- If any error occur due to bad input, than I want to throw it as 400. Currently it's only logging with Exception and Stack. I want additional field status code (result code)

Thanks!!!

azure-functions
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

PramodValavala-MSFT avatar image
0 Votes"
PramodValavala-MSFT answered

@RishabhJain-3518 Only the HTTP Trigger has a request/response style paradigm. For other types of triggers, you can have output bindings to record the error like in a queue if you need to process them later.

In most cases, throwing an exception and logging should do the trick for debugging.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.