Use util.isError check error is Error object.