checked error of a function