exception handling improvement
Merge pull request #2018 from ahmetmircik/minorExceptionHandlingImprovement

Exception handling minor improvement