Created
May 29, 2012 00:30
-
-
Save colinbowern/2821869 to your computer and use it in GitHub Desktop.
Ugly exceptions in System.DirectoryServices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
directoryEntry.Children.Find(objectName, "domainDns"); | |
} | |
catch (DirectoryServicesCOMException exception) | |
{ | |
if (exception.ErrorCode != 0x2030) | |
{ | |
throw; | |
} | |
// TODO: create object here | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment