Catch common error in salt.function and warn and correct
Merge pull request #18683 from cachedout/issue_17190

Catch common error in salt.function and warn and correct