Browse Source

docs(Exception-Handling): add an option to `AbpExceptionHandlingOptions` for enabling/disabling StackTrace

pull/10594/head
Berkan Sasmaz 4 years ago
parent
commit
f75747e7e7
  1. 13
      docs/en/Exception-Handling.md

13
docs/en/Exception-Handling.md

@ -321,13 +321,20 @@ Some exception types are automatically thrown by the framework:
You can also throw these type of exceptions in your code (although it's rarely needed).
## Send exception details to the client
## AbpExceptionHandlingOptions
You can send exceptions to the client via the `SendExceptionsDetailsToClients` property of the `AbpExceptionHandlingOptions` class:
`AbpExceptionHandlingOptions` is the main [options object](Options.md) to configure the exception handling system. You can configure it in the `ConfigureServices` method of your [module](Module-Development-Basics.md):
````csharp
services.Configure<AbpExceptionHandlingOptions>(options =>
Configure<AbpExceptionHandlingOptions>(options =>
{
options.SendExceptionsDetailsToClients = true;
options.EnableStackTrace = false;
});
````
Here, a list of the options you can configure:
* `SendExceptionsDetailsToClients` (default: `false`): You can enable or disable sending exception details to the client.
* `EnableStackTrace` (default: `false`): You can enable or disable sending the `StackTrace` of exception to the client. When you set `EnableStackTrace` to true, it is set to `true` even if `SendExceptionsDetailsToClients` is `false` because it contains the exception details.

Loading…
Cancel
Save