Esempio n. 1
0
 private static ErrorDetails HandleAckeeException(AckeeException exception, BcConfig config)
 {
     if (exception is IInternalException)
     {
         return(HandleInternalException(exception));
     }
     return(HandleBoundedContextException(exception, config));
 }
Esempio n. 2
0
 public static ErrorDetails Build(AckeeException message)
 {
     return(new ErrorDetails(message.Message, message.Code));
 }
Esempio n. 3
0
 public static ErrorDetails Build(AckeeException message, BcConfig config)
 {
     return(new ErrorDetails(message.Message, new ExceptionHandler(config).GetCode(message)));
 }
Esempio n. 4
0
 public int GetCode(AckeeException exception)
 {
     return(_config.Code + exception.Code);
 }
Esempio n. 5
0
        private async Task HandleBusinessException(HttpContext httpContext, AckeeException ackeeException)
        {
            var error = AckeeExceptionHandler.CreateErrorDetail(ackeeException, _config);

            await WriteToResponse(httpContext, error);
        }
Esempio n. 6
0
 internal static ErrorDetails CreateErrorDetail(AckeeException exception, BcConfig config)
 {
     return(HandleAckeeException(exception, config));
 }
Esempio n. 7
0
 private static ErrorDetails HandleBoundedContextException(AckeeException exception, BcConfig config)
 {
     return(ErrorDetails.Build(exception, config));
 }
Esempio n. 8
0
 private static ErrorDetails HandleInternalException(AckeeException exception)
 {
     return(ErrorDetails.Build(exception));
 }