> This page is for SDK, version Legacy.
> For other versions, use one of these documentation indexes:
> - Current (default): https://buildwithfern.com/learn/sdks/current/llms.txt
> - Legacy: https://buildwithfern.com/learn/sdks/legacy/llms.txt

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

## 2.11.2

**`(fix):`** 更改核心文件以完全限定对 `Attribute` 和相关类型的引用，以防名称冲突。

## 2.11.1

**`(fix):`** 当配置 `include-exception-handler: true` 时：

* 从 `Interceptor` 类中移除不需要的 `CaptureException` 方法，因为已经有 `Intercept` 方法了。

## 2.11.0

**`(feat):`** 为 SDK 作者添加构造函数异常处理基础设施，以捕获初始化错误。

当配置 `include-exception-handler: true` 时：

* 向 `ExceptionHandler` 类添加 `CaptureException` 方法，用于捕获异常而不重新抛出
* 使用 try-catch 块包装所有客户端构造函数（根客户端和子客户端）
* 在根客户端构造函数中使用自定义拦截器初始化 `clientOptions.ExceptionHandler`
* 生成一个 `{PackageName}ExceptionInterceptor` 存根类，SDK 作者可以进行自定义

新配置选项：

* `exception-interceptor-class-name`：异常拦截器类的自定义名称（可选）

generators.yml 配置示例：

```yml
groups:
  dotnet-sdk:
    generators:
      - name: fernapi/fern-csharp-sdk
        version: 2.11.0
        config:
          include-exception-handler: true
          exception-interceptor-class-name: MyCustomExceptionInterceptor
```

SDK 作者可以在生成的拦截器类中实现他们的异常捕获逻辑（例如，应用程序监控平台、日志记录）。