ExceptionHelper is a JetBrains Rider and ReSharper plugin that uses AI to choose the best C# exception type for your situation.
It analyzes your code's context and the error message provided in a generic throw new Exception("...") statement to suggest a more precise exception from the standard .NET library (ex., ArgumentNullException, InvalidOperationException, FileNotFoundException, etc.).
- AI powered suggestions: Uses a local LLM to analyze your code and suggest the best exception type.
- Context aware: Considers method parameters, variable checks, and error messages.
- Local and private: Powered by Ollama, ensuring your code stays on your machine.
- Seamless integration: Provides a standard QuickFix (Alt+Enter) in the editor.
- Ensure Ollama is installed and running.
- Access the plugin's settings in
Settings → Tools → Exception Helperto choose the model you want to use - Note: You must pull the model first from your terminal (ex.
ollama pull qwen2.5-coder:7b) and make sure it's served (ollama serve) - Use Alt+Enter or click the lightbulb on the left of a generic
Exceptionkeyword and select Choose best exception type (AI).
This project uses the MIT license
