# ProviderErrorClassifier class

> Turns a provider exception into something the user can act on — ROADMAP #33.

- URL: https://docs.mentoragent.net/api/novior-mentoragent-core/providererrorclassifier
- Verified with: MentorAgent 1.2.0
- Last updated: 2026-10-27
- Packages: Novior.MentorAgent

Before this, every failure that was not an Azure content filter produced the same sentence: *"An error occurred while processing the response."* Part D watched a user paste an intranet image URL, the provider answer `Unable to download image from http://localhost:5224/favicon.png`, and that sentence appear — while the log held both the cause and the exact URL. The person who could have fixed it in two seconds was told nothing.

**The rule that keeps this safe.** A classification is only made when **the user can act on it**. An expired key, a missing deployment, a firewall rule are operator problems: they stay generic, because naming them neither helps the reader nor is something to tell whoever is probing the application. Nothing here ever forwards the provider's own text — `IncludeWorkflowExceptionDetails` keeps its meaning and its default, and the full exception keeps going to the log either way.

Matching is on the provider's message because that is all there is: Azure OpenAI, OpenAI and Ollama report these conditions with different status codes and different exception types but very stable wording. Each rule is anchored on a phrase the provider owns, and an unmatched message falls through to the generic answer rather than to a guess.

## Definition

Namespace: `Novior.MentorAgent.Core`. Package: `Novior.MentorAgent`.

`public static class ProviderErrorClassifier`

```shell
dotnet add package Novior.MentorAgent
```

## Methods

### `Describe`

`public static string Describe(Exception ex, MentorLocalizer localizer)`

A user-facing sentence for `ex`, in the localizer's language. Never contains provider text, an identifier, or a token count.

---

- Previous: [NullMetricsStore class](https://docs.mentoragent.net/api/novior-mentoragent-core/nullmetricsstore.md)
- Next: [MemoryEntry record](https://docs.mentoragent.net/api/novior-mentoragent-data/memoryentry.md)
