Comment
Comment by czechdeveloper
I would just delete that part if it can't be solved. Smaller issues with code are, that you create new string just to compare it (ToLower makes new instance), when you can achieve this just by using proper comparer such as
Good idea would also be to check for existence of Inner exception at all
But I would just live without that check to prevent magical behavior.