[Refactoring] Remove duplication of nothrow check code
Merge pull request #4046 from 9rnsr/refactor_func

[Refactoring] Remove duplication of nothrow check code