3 ms·
PS It's also a bad idea to compare exception messages. Well, I know, it's a sample, but just wanna point that it's not the best one. First - exception messages
by RomanPushkin 12y ago
PS It's also a bad idea to compare exception messages. Well, I know, it's a sample, but just wanna point that it's not the best one. First - exception messages could be internationalized. Second - general string comparison should be done with InvariantCulture, and case-ignorant (and usually strings are trimmed). And even in that case it's not a good idea. It's better to compare types, or message codes.