internal Exception getException(string result)
{
if (result.IndexOf("The context") != -1 &&
result.IndexOf("does not exist on server") != -1)
{
return new PermissionNotFoundException(result);
}
if (result.IndexOf("User") != -1 &&
result.IndexOf("does not have access to option") != -1)
{
return new UnauthorizedAccessException(result);
}
if (result.IndexOf("Option locked") != -1 &&
result.IndexOf("does not have access to option") != -1)
{
return new PermissionLockedException(result);
}
return new Exception(result);
}