ensuring errors such as missing varables are caught and returned to the caller