Catch common error in salt.function and warn and correct