Skip to content

wyteroze/ExceptionHelper

Repository files navigation

ExceptionHelper

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.).

ExceptionHelper in Action

Features:

  • 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.

Getting started

  1. Ensure Ollama is installed and running.
  2. Access the plugin's settings in Settings → Tools → Exception Helper to choose the model you want to use
  3. 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)
  4. Use Alt+Enter or click the lightbulb on the left of a generic Exception keyword and select Choose best exception type (AI).

Other stuff

This project uses the MIT license

About

A Rider and ReSharper plugin that uses AI to choose the best C# exception type for your situation

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published