Exemplo n.º 1
0
        private static BrokenLinkCause ParseCause(EndpointValidationErrorType errorErrorType)
        {
            switch (errorErrorType)
            {
            case EndpointValidationErrorType.InvalidUriFormat:
            case EndpointValidationErrorType.InvalidWebsiteUri:
                return(BrokenLinkCause.InvalidUrl);

            case EndpointValidationErrorType.DnsLookupFailed:
                return(BrokenLinkCause.DnsLookupFailed);

            case EndpointValidationErrorType.CommunicationError:
                return(BrokenLinkCause.CommunicationError);

            case EndpointValidationErrorType.ErrorResponseCode:
                return(BrokenLinkCause.ErrorResponse);

            default:
                throw new ArgumentOutOfRangeException(nameof(errorErrorType), errorErrorType, null);
            }
        }
Exemplo n.º 2
0
 public EndpointValidationError(EndpointValidationErrorType errorType, HttpStatusCode?statusCode = null)
 {
     ErrorType  = errorType;
     StatusCode = statusCode;
 }