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

Meaningless exceptions #2094

Open
zorgoz opened this issue Jan 25, 2025 · 1 comment
Open

Meaningless exceptions #2094

zorgoz opened this issue Jan 25, 2025 · 1 comment

Comments

@zorgoz
Copy link

zorgoz commented Jan 25, 2025

Describe the bug
I am migrating my API from .net framework 4.6 to .net 9. I might have missed something, as I get an exception when trying to generate the API documentation. But the exception is terribly useless:

Image

Expected behavior
I would love to see which HTTP method is that, and, at least, which controller and which action method, so I can go and fix it. Right now this exception doesn't provide any information whatsoever. A code analyzer could also be helpful.

Additional context
I am using controllers, not minimal API. I wanted to try the build time generator, but that failed on the msbuild task itself by missing some parameters. But that requires a separate issue.

@zorgoz
Copy link
Author

zorgoz commented Jan 25, 2025

I found it: in the old WebApi the [Route("path")] attribute on an action method defaulted to HttpGet. I have missed some. But that doesn't change the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant