Browse Source

feat(docs): 添加ExceptionHandling模块文档

pull/1049/head
feijie 1 year ago
parent
commit
21989dde2c
  1. 68
      aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/README.EN.md
  2. 35
      aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/README.md
  3. 46
      aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/README.EN.md
  4. 24
      aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/README.md
  5. 66
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.EN.md
  6. 66
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.md

68
aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/README.EN.md

@ -0,0 +1,68 @@
# LINGYUN.Abp.ExceptionHandling.Emailing
An email notification type based on the ABP framework's **IExceptionSubscriber** interface.
## Features
* Supports exception email notifications
* Supports custom email templates
* Supports multilingual email content
* Supports stack trace sending
* Supports mapping between exception types and recipient mailboxes
## Configuration and Usage
Before use, you need to configure **AbpExceptionHandlingOptions** to define which exceptions need notifications,
then configure **AbpEmailExceptionHandlingOptions** to define specific exception type notification methods.
```csharp
[DependsOn(
typeof(AbpEmailingExceptionHandlingModule)
)]
public class YouProjectModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
// Customize exceptions to handle
Configure<AbpExceptionHandlingOptions>(options =>
{
// Add exception types that need to be handled
options.Handlers.Add<AbpException>();
});
// Customize exception types that need email notifications
Configure<AbpEmailExceptionHandlingOptions>(options =>
{
// Whether to send stack trace information
options.SendStackTrace = true;
// Default receiving email for unspecified exception receivers
options.DefaultReceiveEmail = "colin.in@foxmail.com";
// Specify which email to send for a certain exception type
options.HandReceivedException<AbpException>("colin.in@foxmail.com");
});
}
}
```
## Configuration Options
* `SendStackTrace`: Whether to include exception stack trace in the email
* `DefaultTitle`: Default email title
* `DefaultContentHeader`: Default email content header
* `DefaultContentFooter`: Default email content footer
* `DefaultReceiveEmail`: Default exception receiving email
* `Handlers`: Dictionary mapping exception types to receiving emails
## Localization Resources
The module includes localization resources in the following languages:
* en
* zh-Hans
## Related Links
* [Base Exception Handling Module](../LINGYUN.Abp.ExceptionHandling/README.EN.md)
* [Exception Real-time Notification Module](../../../modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.EN.md)
## More
For more information and configuration examples, please refer to the [documentation](https://github.com/colinin/abp-next-admin).

35
aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/README.md

@ -2,13 +2,20 @@
基于abp框架底层的**IExceptionSubscriber**的邮件通知类型 基于abp框架底层的**IExceptionSubscriber**的邮件通知类型
## 功能特性
* 支持异常邮件通知
* 支持自定义邮件模板
* 支持多语言邮件内容
* 支持堆栈信息发送
* 支持异常类型与接收邮箱映射
## 配置使用 ## 配置使用
使用前需要配置**AbpExceptionHandlingOptions**定义需要发送通知的异常 使用前需要配置**AbpExceptionHandlingOptions**定义需要发送通知的异常
然后配置**AbpEmailExceptionHandlingOptions**定义具体异常类型通知方式 然后配置**AbpEmailExceptionHandlingOptions**定义具体异常类型通知方式
```csharp ```csharp
[DependsOn( [DependsOn(
typeof(AbpEmailingExceptionHandlingModule) typeof(AbpEmailingExceptionHandlingModule)
)] )]
@ -34,4 +41,28 @@
}); });
} }
} }
``` ```
## 配置项说明
* `SendStackTrace`: 是否在邮件中包含异常堆栈信息
* `DefaultTitle`: 默认邮件标题
* `DefaultContentHeader`: 默认邮件内容头部
* `DefaultContentFooter`: 默认邮件内容底部
* `DefaultReceiveEmail`: 默认异常接收邮箱
* `Handlers`: 异常类型与接收邮箱的映射字典
## 本地化资源
模块包含以下语言的本地化资源:
* en
* zh-Hans
## 相关链接
* [基础异常处理模块](../LINGYUN.Abp.ExceptionHandling/README.md)
* [异常实时通知模块](../../../modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.md)
## 更多
有关更多信息和配置示例,请参阅[文档](https://github.com/colinin/abp-next-admin)。

46
aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/README.EN.md

@ -0,0 +1,46 @@
# LINGYUN.Abp.ExceptionHandling
A secondary extension based on the ABP framework's **IExceptionSubscriber** interface, used for customizing exception notification methods.
## Features
* Provides unified exception handling and notification mechanism
* Supports custom exception handlers
* Supports exception notification filtering
* Supports integration with other notification modules (such as email, real-time notifications, etc.)
## Configuration and Usage
Just configure **AbpExceptionHandlingOptions** to define which exceptions need to send notifications.
```csharp
[DependsOn(
typeof(AbpExceptionHandlingModule)
)]
public class YouProjectModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
// Customize exception handling
Configure<AbpExceptionHandlingOptions>(options =>
{
// Add exception types that need to be handled
options.Handlers.Add<AbpException>();
});
}
}
```
## Configuration Options
* `Handlers`: List of exception handlers, used to define which exception types need to be handled
* `HasNotifierError`: Check if an exception needs to send notifications
## Extension Modules
* [LINGYUN.Abp.ExceptionHandling.Emailing](../LINGYUN.Abp.ExceptionHandling.Emailing/README.EN.md): Exception email notification module
* [LINGYUN.Abp.ExceptionHandling.Notifications](../../../modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.EN.md): Exception real-time notification module
## More
For more information and configuration examples, please refer to the [documentation](https://github.com/colinin/abp-next-admin).

24
aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/README.md

@ -2,12 +2,18 @@
基于abp框架底层的**IExceptionSubscriber**实现二次扩展,用于自定义异常通知方式 基于abp框架底层的**IExceptionSubscriber**实现二次扩展,用于自定义异常通知方式
## 功能特性
* 提供统一的异常处理和通知机制
* 支持自定义异常处理程序
* 支持异常通知筛选
* 支持与其他通知模块集成(如邮件、实时通知等)
## 配置使用 ## 配置使用
使用前只需配置**AbpExceptionHandlingOptions**定义需要发送通知的异常即可。 使用前只需配置**AbpExceptionHandlingOptions**定义需要发送通知的异常即可。
```csharp ```csharp
[DependsOn( [DependsOn(
typeof(AbpExceptionHandlingModule) typeof(AbpExceptionHandlingModule)
)] )]
@ -23,4 +29,18 @@
}); });
} }
} }
``` ```
## 配置项说明
* `Handlers`: 异常处理程序列表,用于定义需要处理的异常类型
* `HasNotifierError`: 检查异常是否需要发送通知
## 扩展模块
* [LINGYUN.Abp.ExceptionHandling.Emailing](../LINGYUN.Abp.ExceptionHandling.Emailing/README.md): 异常邮件通知模块
* [LINGYUN.Abp.ExceptionHandling.Notifications](../../../modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.md): 异常实时通知模块
## 更多
有关更多信息和配置示例,请参阅[文档](https://github.com/colinin/abp-next-admin)。

66
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.EN.md

@ -0,0 +1,66 @@
# LINGYUN.Abp.ExceptionHandling.Notifications
A real-time notification type based on the ABP framework's **IExceptionSubscriber** interface, used to send exception information to users through real-time notifications.
## Features
* Supports real-time exception notifications
* Supports multi-tenancy
* Supports notification templates
* Supports system-level notifications
* Integrated with common notification module
## Configuration and Usage
Before use, you need to configure **AbpExceptionHandlingOptions** to define which exceptions need notifications.
```csharp
[DependsOn(
typeof(AbpNotificationsExceptionHandlingModule)
)]
public class YouProjectModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
// Customize exceptions to handle
Configure<AbpExceptionHandlingOptions>(options =>
{
// Add exception types that need to be handled
options.Handlers.Add<AbpException>();
});
}
}
```
## Notification Content
Exception notifications include the following information:
* `header`: Exception notification header information
* `footer`: Exception notification footer information
* `loglevel`: Log level
* `stackTrace`: Exception stack trace information
## Notification Names
The module uses the following notification names:
* `NotificationsCommonNotificationNames.ExceptionHandling`: Exception handling notification name
## Notification Template
* Sender: System
* Notification Level: Error
* Multi-tenant Support: Yes
## Dependencies
* `AbpExceptionHandlingModule`: Base exception handling module
* `AbpNotificationsCommonModule`: Common notification module
## Related Links
* [Base Exception Handling Module](../../../framework/common/LINGYUN.Abp.ExceptionHandling/README.EN.md)
* [Exception Email Notification Module](../../../framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/README.EN.md)
## More
For more information and configuration examples, please refer to the [documentation](https://github.com/colinin/abp-next-admin).

66
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/README.md

@ -0,0 +1,66 @@
# LINGYUN.Abp.ExceptionHandling.Notifications
基于abp框架底层的**IExceptionSubscriber**的实时通知类型,用于将异常信息通过实时通知方式发送给用户。
## 功能特性
* 支持异常实时通知
* 支持多租户
* 支持通知模板
* 支持系统级通知
* 集成了通用通知模块
## 配置使用
使用前需要配置**AbpExceptionHandlingOptions**定义需要发送通知的异常。
```csharp
[DependsOn(
typeof(AbpNotificationsExceptionHandlingModule)
)]
public class YouProjectModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
// 自定义需要处理的异常
Configure<AbpExceptionHandlingOptions>(options =>
{
// 加入需要处理的异常类型
options.Handlers.Add<AbpException>();
});
}
}
```
## 通知内容
异常通知包含以下信息:
* `header`: 异常通知头部信息
* `footer`: 异常通知底部信息
* `loglevel`: 日志级别
* `stackTrace`: 异常堆栈信息
## 通知名称
模块使用以下通知名称:
* `NotificationsCommonNotificationNames.ExceptionHandling`: 异常处理通知名称
## 通知模板
* 发送者: System
* 通知级别: Error
* 支持多租户: 是
## 依赖模块
* `AbpExceptionHandlingModule`: 基础异常处理模块
* `AbpNotificationsCommonModule`: 通用通知模块
## 相关链接
* [基础异常处理模块](../../../framework/common/LINGYUN.Abp.ExceptionHandling/README.md)
* [异常邮件通知模块](../../../framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/README.md)
## 更多
有关更多信息和配置示例,请参阅[文档](https://github.com/colinin/abp-next-admin)。
Loading…
Cancel
Save