An Azure FunctionApp has 1.5GB of RAM. Sometimes my code goes above this value, and I would like to catch this exception.
Is it possible to do it? The simple try/catch doesn't seem to work.
An Azure FunctionApp has 1.5GB of RAM. Sometimes my code goes above this value, and I would like to catch this exception.
Is it possible to do it? The simple try/catch doesn't seem to work.
I do not think there is a separate way to catch this particular type exception, however as best practice you need to use exception handling in your code as given in the docs
,
catch(System.Exception ex)
{
log.LogError(ex, ex.Message);
}
There are a few exceptions you cannot (guaranteed to be able to) catch.
StackOverflowException - If you run out of the stack, then you cannot possibly execute code that very likely call another function.
OutOfMemoryException - Likely your handling code may need more memory to work.