Skip to content
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

Invalid configuration of the ExceptionHandling #99

Open
SandGrainOne opened this issue Sep 19, 2023 · 1 comment
Open

Invalid configuration of the ExceptionHandling #99

SandGrainOne opened this issue Sep 19, 2023 · 1 comment
Labels
kind/bug Something isn't working status/blocked Further work depending on the completion of some other task/PoC/issue

Comments

@SandGrainOne
Copy link
Member

SandGrainOne commented Sep 19, 2023

Description of the bug

The following message was registered in application insights in production:

The exception handler configured on ExceptionHandlerOptions produced a 404 status response. This InvalidOperationException containing the original exception was thrown since this is often due to a misconfigured ExceptionHandlingPath. If the exception handler is expected to return 404 status responses then set AllowStatusCode404Response to true.

Looking into this we see that the ExceptionHandlier is pointed to a non existent endpoint.

Program.cs L277

app.UseExceptionHandler("/filescan/api/v1/error");

We need to either ensure that the endpoint exists or find a solution that doesn't require an endpoint. Is there a default handler that can be used instead?

Steps To Reproduce

Force an exception that isn't handled by the logic, but bobble up to the built in middleware.

Additional Information

A simple fix would be to add a Controller to support the missing endpoint. We've done this in other applications.

@SandGrainOne SandGrainOne added the kind/bug Something isn't working label Sep 19, 2023
@olebhansen olebhansen added the status/blocked Further work depending on the completion of some other task/PoC/issue label Sep 9, 2024
@olebhansen
Copy link

Pending a decision on a prossible re-write/deprecation of file-scan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working status/blocked Further work depending on the completion of some other task/PoC/issue
Projects
None yet
Development

No branches or pull requests

2 participants