CSC.REP.ExceptionManager 0.2.0

This library assist consumers with Exception Manager.  Predefined configurable destinations - ServiceBus, CosmosDB, EventGrid - are acceptable and specified in the configuration file. "local.setting.json"  The Manager route the Exception to the chosen destination(s).

Install-Package CSC.REP.ExceptionManager -Version 0.2.0
dotnet add package CSC.REP.ExceptionManager --version 0.2.0
<PackageReference Include="CSC.REP.ExceptionManager" Version="0.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CSC.REP.ExceptionManager --version 0.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Usage:

In the consumer, have some logic like:

try
{
    throw new System.Exception("Example exception!");
}
catch (System.Exception ex)
{
    Manager exceptionManager = new Manager();
    string result = await exceptionManager.LogAsync(ex.Message, AsyncCallback<bool>);
}

then make sure you have the callback function definied:

public static async Task<bool> AsyncCallback<T>()
{
    return await Task.FromResult(false);
}

and lastly, update the local.settings.json file: (with something like...)

"CongifurationSettings_Retry": 3,
"CongifurationSettings_Failover_or_Broadcast": "Broadcast",

"CongifurationSettings_CosmosDB_Origin": "NorthAmerica",
"CongifurationSettings_CosmosDB_Endpoint_Url": "https://sandeepcosmosdb.documents.azure.com:443/",
"CongifurationSettings_CosmosDB_Auth_Key": "d0iAv73TxcBx8kecIBADeuX7WTcUhbIBgSDXwmjKtAZ4TCu6VnkCLpcznIBcfv61oxzr5rbSV5OogKLV70Jxfg==",
"CongifurationSettings_CosmosDB_Database": "mycosmosdb",
"CongifurationSettings_CosmosDB_Collection": "mydatacollection",

"CongifurationSettings_ServiceBus_Origin": "NorthAmerica",
"CongifurationSettings_ServiceBus_Endpoint_Url": "Endpoint=sb://prakumar.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=TqrnQXTwFqMSWuN8Qx5vUoE2gQKkYlRatQthIBKozWw=",
"CongifurationSettings_ServiceBus_Destination": "Topic",
"CongifurationSettings_ServiceBus_Topic": "productpubexception",
"CongifurationSettings_ServiceBus_Queue": "",
"CongifurationSettings_ServiceBus_Deadletter": "productexception",

"CongifurationSettings_EventGrid_Origin": "NorthAmerica",
"CongifurationSettings_EventGrid_Endpoint_Url": "https://myeventgrid.westus-1.eventgrid.azure.net/api/events",
"CongifurationSettings_EventGrid_Key": "aeg-sas-key",
"CongifurationSettings_EventGrid_Value": "oFJu3kiqUfh8j+b+CqaW41KwhSFBj/JqJ47//LKKBD8="

Usage:

In the consumer, have some logic like:

try
{
    throw new System.Exception("Example exception!");
}
catch (System.Exception ex)
{
    Manager exceptionManager = new Manager();
    string result = await exceptionManager.LogAsync(ex.Message, AsyncCallback<bool>);
}

then make sure you have the callback function definied:

public static async Task<bool> AsyncCallback<T>()
{
    return await Task.FromResult(false);
}

and lastly, update the local.settings.json file: (with something like...)

"CongifurationSettings_Retry": 3,
"CongifurationSettings_Failover_or_Broadcast": "Broadcast",

"CongifurationSettings_CosmosDB_Origin": "NorthAmerica",
"CongifurationSettings_CosmosDB_Endpoint_Url": "https://sandeepcosmosdb.documents.azure.com:443/",
"CongifurationSettings_CosmosDB_Auth_Key": "d0iAv73TxcBx8kecIBADeuX7WTcUhbIBgSDXwmjKtAZ4TCu6VnkCLpcznIBcfv61oxzr5rbSV5OogKLV70Jxfg==",
"CongifurationSettings_CosmosDB_Database": "mycosmosdb",
"CongifurationSettings_CosmosDB_Collection": "mydatacollection",

"CongifurationSettings_ServiceBus_Origin": "NorthAmerica",
"CongifurationSettings_ServiceBus_Endpoint_Url": "Endpoint=sb://prakumar.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=TqrnQXTwFqMSWuN8Qx5vUoE2gQKkYlRatQthIBKozWw=",
"CongifurationSettings_ServiceBus_Destination": "Topic",
"CongifurationSettings_ServiceBus_Topic": "productpubexception",
"CongifurationSettings_ServiceBus_Queue": "",
"CongifurationSettings_ServiceBus_Deadletter": "productexception",

"CongifurationSettings_EventGrid_Origin": "NorthAmerica",
"CongifurationSettings_EventGrid_Endpoint_Url": "https://myeventgrid.westus-1.eventgrid.azure.net/api/events",
"CongifurationSettings_EventGrid_Key": "aeg-sas-key",
"CongifurationSettings_EventGrid_Value": "oFJu3kiqUfh8j+b+CqaW41KwhSFBj/JqJ47//LKKBD8="

Release Notes

Initial release supports Retry logic, failover and broadcast notification types.

Dependencies

This package has no dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.2.0 373 6/11/2018
0.1.0 282 6/11/2018