As shown in
IMPALA-6308, the following idiom of not using hard coded TErrorCode::type with Status(TErrorCode::type error, const ArgType& arg0, ...) is pretty error prone as the format string changes. We should consider replacing error_code with constant TErrorCode::type like most other places in the code.
In general, Status(TErrorCode::type error, const ArgType& arg0,..) relies on the caller to pass the right number of arguments to match the number of substitution argument. In theory, if our test coverage is comprehensive, we should catch cases in which there is any mismatch. However, it's unclear if all usages of Status(TErrorCode::type error, const ArgType& arg0,..) are exercised. While the code coverage is the bigger issue here, it'd be nice to implement some compilation check to catch any mismatch between the number of arguments passed to Status() and the number of substitution arguments in the format string. This may be a follow on change after the above clean up is done.