ZayniFramework.ExceptionHandling
2.0.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package ZayniFramework.ExceptionHandling --version 2.0.1
NuGet\Install-Package ZayniFramework.ExceptionHandling -Version 2.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ZayniFramework.ExceptionHandling" Version="2.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ZayniFramework.ExceptionHandling --version 2.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ZayniFramework.ExceptionHandling, 2.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ZayniFramework.ExceptionHandling as a Cake Addin #addin nuget:?package=ZayniFramework.ExceptionHandling&version=2.0.1 // Install ZayniFramework.ExceptionHandling as a Cake Tool #tool nuget:?package=ZayniFramework.ExceptionHandling&version=2.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ExceptionHandling module example.
Add LoggingSettings and ExceptionHandling section in your app.config or web.config file.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="ZayniFramework" type="ZayniFramework.Common.ZayniConfigSection, ZayniFramework.Common"/>
</configSections>
<ZayniFramework>
<LoggingSettings eventLogEnable="false" logEnable="true">
<DefaultTextLogger>
<add name="_DefaultLog" enable="true" maxSize="8" consoleOutput="true">
<LogFile path="D:\Logs\Zayni\Logging.TestLog.log"/>
</add>
</DefaultTextLogger>
</LoggingSettings>
<ExceptionHandling>
<DefaultTextLoggingPolicy enableDefaultPolicy="true" enableDefaultPolicyEventLog="true" needRethrow="false" defaultPolicyLogFilePath="D:\Logs\Zayni\ExceptionHandling.UnitTest.Text.log"/>
<EMailNotifyPolicy textLogEnable="true" textLogPath="D:\Logs\Zayni\ExceptionHandling.UnitTest.Email.log" eventLogEnable="false" needRethrow="false" emailNotifyEnable="true" smtpPort="587" smtpHost="smtp.gmail.com" enableSsl="true" smtpDomain="" smtpAccount="test@gmail.com" smtpPassword="XXX" fromEmailAddress="system@gmail.com" fromDisplayName="Some Error Happend" toEmailAddress="test@gmail.com" mailSubject="ZayniFramework Exception Handling Unit Test"/>
</ExceptionHandling>
</ZayniFramework>
</configuration>
Add namespace using
using ZayniFramework.ExceptionHandling;
Then, you can handle the exception like this:
public static void DoSomethingWrong() => throw new ApplicationException( "Opps... Something goes wrong..." );
try
{
DoSomethingWrong();
}
catch ( Exception ex )
{
ExceptionAgent.ExecuteDefaultExceptionPolicy( ex, eventTitle: "AAA" );
}
try
{
DoSomethingWrong();
}
catch ( Exception ex )
{
ExceptionAgent.ExecuteEMailNotifyExceptionPolicy( ex, eventTitle: "FFF" );
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- ZayniFramework.Common (>= 2.0.1)
- ZayniFramework.Logging (>= 2.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
8.0.142 | 173 | 3/19/2024 |
8.0.141 | 156 | 1/4/2024 |
8.0.140 | 151 | 12/17/2023 |
6.0.138 | 134 | 3/19/2024 |
6.0.137 | 166 | 9/20/2023 |
6.0.136 | 144 | 9/14/2023 |
6.0.135 | 181 | 9/10/2023 |
6.0.134 | 173 | 7/12/2023 |
6.0.133 | 165 | 7/10/2023 |
6.0.132 | 173 | 7/7/2023 |
6.0.131 | 184 | 6/19/2023 |
6.0.130 | 172 | 6/19/2023 |
6.0.129 | 10,314 | 7/2/2022 |
6.0.128 | 539 | 1/16/2022 |
6.0.127 | 534 | 1/15/2022 |
6.0.126 | 511 | 1/15/2022 |
6.0.125 | 336 | 1/8/2022 |
6.0.125-hotfix1 | 217 | 1/8/2022 |
6.0.124 | 329 | 1/7/2022 |
6.0.123 | 407 | 11/14/2021 |
5.0.129 | 548 | 7/2/2022 |
5.0.128 | 488 | 1/16/2022 |
5.0.125 | 310 | 1/8/2022 |
5.0.124 | 322 | 1/7/2022 |
5.0.123 | 462 | 11/14/2021 |
5.0.122 | 507 | 10/11/2021 |
5.0.121 | 514 | 5/1/2021 |
3.1.137 | 158 | 9/20/2023 |
3.1.136 | 165 | 9/14/2023 |
3.1.135 | 165 | 9/10/2023 |
3.1.134 | 157 | 7/12/2023 |
3.1.133 | 157 | 7/11/2023 |
3.1.132 | 177 | 7/8/2023 |
3.1.131 | 173 | 6/19/2023 |
3.1.130 | 335 | 2/1/2023 |
3.1.129 | 538 | 7/2/2022 |
3.1.128 | 483 | 1/16/2022 |
3.1.125 | 313 | 1/8/2022 |
3.1.124 | 321 | 1/7/2022 |
3.1.123 | 485 | 11/14/2021 |
3.1.122 | 511 | 10/11/2021 |
3.1.121 | 536 | 5/1/2021 |
2.31.120 | 497 | 3/14/2021 |
2.30.115 | 3,258 | 3/6/2021 |
2.30.114 | 426 | 3/6/2021 |
2.20.101 | 486 | 3/1/2021 |
2.19.3 | 530 | 2/11/2021 |
2.19.2 | 10,093 | 2/6/2021 |
2.19.1 | 581 | 1/6/2021 |
2.19.0 | 597 | 1/1/2021 |
2.18.3 | 614 | 12/27/2020 |
2.18.2 | 1,220 | 8/29/2020 |
2.18.1 | 515 | 8/26/2020 |
2.18.0 | 4,819 | 8/20/2020 |
2.17.135 | 563 | 8/19/2020 |
2.17.134 | 639 | 7/28/2020 |
2.17.133 | 622 | 7/27/2020 |
2.17.132 | 676 | 7/18/2020 |
2.17.131 | 788 | 7/11/2020 |
2.16.130 | 741 | 6/13/2020 |
2.15.128 | 661 | 6/3/2020 |
2.15.127 | 668 | 5/31/2020 |
2.15.126 | 1,498 | 4/30/2020 |
2.14.122 | 627 | 4/13/2020 |
2.13.100 | 661 | 3/12/2020 |
2.12.51 | 751 | 2/18/2020 |
2.11.50 | 699 | 2/10/2020 |
2.10.44 | 776 | 1/30/2020 |
2.9.43 | 935 | 1/11/2020 |
2.8.42 | 723 | 1/10/2020 |
2.8.41 | 691 | 1/5/2020 |
2.7.40 | 711 | 1/2/2020 |
2.7.39 | 629 | 1/2/2020 |
2.7.38 | 779 | 1/1/2020 |
2.6.37 | 719 | 12/23/2019 |
2.6.35 | 880 | 12/4/2019 |
2.6.1 | 673 | 12/2/2019 |
2.6.0 | 666 | 11/28/2019 |
2.5.2 | 847 | 11/26/2019 |
2.5.1 | 723 | 11/12/2019 |
2.5.0 | 587 | 11/9/2019 |
2.4.3 | 754 | 10/16/2019 |
2.4.2 | 698 | 10/16/2019 |
2.4.1 | 751 | 9/20/2019 |
2.3.113 | 421 | 3/6/2021 |
2.3.112 | 446 | 3/6/2021 |
2.3.28 | 715 | 9/19/2019 |
2.3.27 | 808 | 8/30/2019 |
2.3.26 | 796 | 8/20/2019 |
2.3.25 | 707 | 8/12/2019 |
2.3.22 | 687 | 7/31/2019 |
2.3.21 | 825 | 7/20/2019 |
2.3.20 | 812 | 6/22/2019 |
2.3.19 | 738 | 6/14/2019 |
2.3.18 | 680 | 6/13/2019 |
2.3.17 | 673 | 6/13/2019 |
2.3.15 | 706 | 6/8/2019 |
2.3.14 | 736 | 6/8/2019 |
2.3.13 | 711 | 5/30/2019 |
2.3.12 | 577 | 5/24/2019 |
2.3.11 | 604 | 5/24/2019 |
2.3.10 | 625 | 5/21/2019 |
2.3.9 | 629 | 5/9/2019 |
2.3.8 | 627 | 5/8/2019 |
2.3.7 | 668 | 4/30/2019 |
2.3.6 | 754 | 4/23/2019 |
2.3.5 | 693 | 4/19/2019 |
2.3.4 | 685 | 4/18/2019 |
2.3.3 | 650 | 4/17/2019 |
2.3.2 | 654 | 4/6/2019 |
2.3.1 | 727 | 12/15/2018 |
2.3.0 | 811 | 12/7/2018 |
2.2.6 | 758 | 11/25/2018 |
2.2.1 | 762 | 11/17/2018 |
2.2.0 | 740 | 11/16/2018 |
2.1.0 | 786 | 11/15/2018 |
2.0.1 | 781 | 11/6/2018 |
2.0.0 | 815 | 11/4/2018 |