-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve extension startup error discoverability/logging #2927
Comments
@v-galatrash we can evaluate this change, but it would be a breaking change not doable within a major version or some opt-in switch. This failure would happen at startup time. When you say "application error handler", what exactly are you meaning? Not catching this exception would most likely crash the entire process. |
@jviau crashing application at startup with a log of the exception is better than sending the error to the error stream (where I couldn't find it in the app-insights which in the end caused the application to crash anyway. IMO, libraries must not hide exceptions and should propagate them to the callers. |
@v-galatrash I think it will be more productive if we focus on the issue and not a proposed solution. There may be a lot of nuance and context not captured here as to why we catch this exception (and avoiding crashing the process). The issue as I understand it, is that it is hard to identify failures during extension startup. Can you expand on not finding it in app insights? Was, app insights not configured? Where you able to see this error locally? |
@jviau I don't see this error locally as the function uses my local credentials when accessing the blob storage (and receiving blob triggers) which works normally. I face the error in the cloud where I've switched to using managed-identity access. App-insights is configured properly and I see other traces and exception, but I don't see the details logged through error stream (inside the auto-generated code - |
Ah noticed this writes to |
Just to make my point clearer, when you catch the error and don't propagate it, my code assumes it succeeded and proceeds thinking the configuration went without errors which causes more errors to occur at a later stage where the configured data is used while it wasn't initialized. Please let me know when this behavior is improved/changed or a change plan is set forward. |
Next steps:
|
@jviau just to give further insights, when I downloaded the source functions worker source code and linked to it directly. I was able to retrieve this error:
I added a reference for the missing DLL |
The generated code from this code generation template is reporting the exception in the error stream but not passing it to the application (in this case the Azure Function) error handler. This caused me to waste few days chasing an issue where my function's failed to startup in the cloud. I couldn't find the issue until I downloaded the source code to my local machine and referenced the code directly in my solution to be able to debug locally and find what caused the failures.
This must remove the try/catch to allow developers more flexibility and control over their code.
The text was updated successfully, but these errors were encountered: