-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(exception handler): removed dependencies
- Loading branch information
1 parent
698837d
commit eae5a0a
Showing
9 changed files
with
120 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ public enum ExceptionHandlingStrategy | |
Rethrow, | ||
Return, | ||
Throw, | ||
Continue | ||
} |
17 changes: 17 additions & 0 deletions
17
AElf.ExceptionHandler/Extensions/ExceptionHandlerConfigurationExtension.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.Collections.Concurrent; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.DependencyInjection.Extensions; | ||
|
||
namespace AElf.ExceptionHandler.Extensions; | ||
|
||
public static class ExceptionHandlerConfigurationExtension | ||
{ | ||
public static IServiceCollection AddExceptionHandler(this IServiceCollection services) | ||
{ | ||
services.TryAddTransient<IInterceptor, ExceptionHandler>(); | ||
services.TryAddSingleton<ConcurrentDictionary<string, ExceptionHandlerInfo>>(); | ||
services.TryAddSingleton<ConcurrentDictionary<string, Func<object, object[], Task>>>(); | ||
services.TryAddSingleton<ConcurrentDictionary<string, List<ExceptionHandlerAttribute>>>(); | ||
return services; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace AElf.ExceptionHandler; | ||
|
||
public class ReturnTypeMismatchException : Exception | ||
{ | ||
public ReturnTypeMismatchException(string message) : base(message) | ||
{ | ||
} | ||
} |