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

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