public static WebDavClientException Create (HttpRequestException x)
{
var match = Regex.Match (x.Message, @"'(?<code>\d{3})'\s+\('(?<description>.*?)'\)");
if (match.Success)
{
return new WebDavClientException (
x,
(HttpStatusCode) int.Parse (match.Groups["code"].Value),
match.Groups["description"].Value);
}
else
{
return new WebDavClientException (x, null, null);
}
}
}