private static ErrorDetails HandleAckeeException(AckeeException exception, BcConfig config) { if (exception is IInternalException) { return(HandleInternalException(exception)); } return(HandleBoundedContextException(exception, config)); }
public static ErrorDetails Build(AckeeException message) { return(new ErrorDetails(message.Message, message.Code)); }
public static ErrorDetails Build(AckeeException message, BcConfig config) { return(new ErrorDetails(message.Message, new ExceptionHandler(config).GetCode(message))); }
public int GetCode(AckeeException exception) { return(_config.Code + exception.Code); }
private async Task HandleBusinessException(HttpContext httpContext, AckeeException ackeeException) { var error = AckeeExceptionHandler.CreateErrorDetail(ackeeException, _config); await WriteToResponse(httpContext, error); }
internal static ErrorDetails CreateErrorDetail(AckeeException exception, BcConfig config) { return(HandleAckeeException(exception, config)); }
private static ErrorDetails HandleBoundedContextException(AckeeException exception, BcConfig config) { return(ErrorDetails.Build(exception, config)); }
private static ErrorDetails HandleInternalException(AckeeException exception) { return(ErrorDetails.Build(exception)); }